Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

CSDReader (Architecture & Idea)

psineur edited this page May 19, 2011 · 5 revisions

CSDElement

CSDElement is generic element, that holds information about one element(Sprite, Background, Label, etc...) CSDElement gives user interface to specific element representation. In common case different CSDElements should work as factories for generating (or doing a setup of) different Cocos2D nodes.

CSDElement's SubClasses

  • CSDSprite - can create CCSprites or CCSprites subclasses for given CCSpriteBatchNode (since 0.1)
  • CSDCustomNode - can apply it's CCNode Properties to any given CCNode subclass. Probably can handle other CSD files. Making it possible to include one csd node to another.
  • CSDLabel - can create CCLabelBMFont's
  • CSDBackgroundLayer - creates CCLayerColor for background, that was set in CSD File (since 0.1). Should support only color & opacity.

CSDReader

CSDReader's instances are created from CSD File. After init it can be used to automatically create CCNode with sprites, or node with sprites for given CCSpriteBatchNode. Also it gives public access to all loaded CSDEelement's and can be used for getting tags with elements name.

User can pop some CSDElement from CSDReader to use it later, creating Cocos2D Nodes from that CSDElement manually. CSDelements that are left within CSDReader will be used for next automatic node generation by this CSDReader.

CSDReader's dictionary will contain info about background, but it will not add it in autocreated node, if opacity of the background is zero.

Clone this wiki locally