cocos2d-iphone-extensions  0.2
Cocos2D Extensions API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Properties
CCBigImage Class Reference

List of all members.

Public Member Functions

(id) - initWithTilesFile:tilesExtension:tilesZ:
(void) - loadTilesInRect:

Static Public Member Functions

(id) + nodeWithTilesFile:tilesExtension:tilesZ:

Protected Attributes

CGSize _screenLoadRectExtension
CGRect _loadedRect
NSMutableArray * _dynamicChildren
NSMutableArray * _levelTextures
NSThread * _tilesLoadThread
BOOL _tilesLoadThreadIsSleeping
BOOL _significantPositionChange
BOOL _dynamicMode

Properties

NSThread * tilesLoadThread
CGSize screenLoadRectExtension
BOOL dynamicMode

Detailed Description

holds parts of big image as an idvididual dynamically unloadable tiles. Besides dynamic tiles this node can have normal children, such as CCSprite, layer, etc...

CCBigImage is refactored DynamicTiledLevelNode New Features: 1) Tile-Cutter ( https://github.com/psineur/Tile-Cutter ) instead of Gimp & xcftools 2) Removed unnecessary code, more comments, etc...

Besides Dynamic Mode, when all tiles are loaded in independent thread this node also supports Static Mode (dynamicMode = NO) when all tiles are preloaded and no additional thread is used. However, even in staticMode tiles that aren't visible now in screen rect will be not rendered to increase performance.

LIMITATIONS: CCCamera may be not supported.


Member Function Documentation

- (id) initWithTilesFile: (NSString *)  filename
tilesExtension: (NSString *)  extension
tilesZ: (int)  tilesZ 

Inits CCBigImage. Designated initializer.

Parameters:
filenameplist filename from Tile-Cutter.
extensionfile extension, that will be used for all tiles instead of their extensions that are in plist file. Pass nil to kep original extension from plist file.
tilesZzOrder, that will be used for all tiles. Usefull when you have other nodes added as children to CCBigImage.
- (void) loadTilesInRect: (CGRect)  loadRect

Load tiles by request in a given rect (in nodes coordinates)

+ (id) nodeWithTilesFile: (NSString *)  filename
tilesExtension: (NSString *)  extension
tilesZ: (int)  tilesZ 

Property Documentation

- (BOOL) dynamicMode [read, write, assign]

if YES - then only needed (visible in screen rect) tiles will be loaded at the moment via independent thread if NO - all tiles will be preloaded and no no additional thread will be used This property can be changed at runtime in both directions. On the Mac by default this property is OFF On the iOS devices by default this property is ON

- (CGSize) screenLoadRectExtension [read, write, assign]

Returns size that describes in what distance beyond each side of the screen tiles should be loaded to avoid holes when levels scrolls fast. By default it's equal to first tile's size.


The documentation for this class was generated from the following file: