CocosSharp.CCTMXLayer Class
represents the TMX layer.

See Also: CCTMXLayer Members

Syntax

public class CCTMXLayer : CCSpriteBatchNode

Remarks

It is a subclass of CocosSharp.CCSpriteBatchNode. By default the tiles are rendered using a CocosSharp.CCTextureAtlas. If you modify a tile on runtime, then, that tile will become a CocosSharp.CCSprite, otherwise no CocosSharp.CCSprite objects are created. The benefits of using CocosSharp.CCSprite objects as tiles are:

CocosSharp.CCSpriteBatchNode CocosSharp.CCTextureAtlas CocosSharp.CCSprite CocosSharp.CCSprite CocosSharp.CCSprite

If the layer contains a property named "cc_vertexz" with an integer (in can be positive or negative), then all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth.

On the other hand, if the "cc_vertexz" property has the "automatic" value, then the tiles will use an automatic vertex Z value. Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be:

glAlphaFunc( GL_GREATER, value )

"value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer. The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different value, like 0.5.

For further information, please see the programming guide:

http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps

http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps

v0.8.1 Tiles can have tile flags for additional properties. At the moment only flip horizontal and flip vertical are used. These bit flags are defined in TMXXMLParser.h.

1.1

v0.8.1 Tiles can have tile flags for additional properties. At the moment only flip horizontal and flip vertical are used. These bit flags are defined in TMXXMLParser.h.

1.1

tiles (Sprite) can be rotated/scaled/moved with a nice API tiles (Sprite) can be rotated/scaled/moved with a nice API

Requirements

Namespace: CocosSharp
Assembly: CocosSharp (in CocosSharp.dll)