LHScene Reference

Inherits from
LHScene.h

Overview

LHScene class is used to load a level file into Cocos2d-X v3 engine. End users will have to subclass this class in order to add they're own game logic.

Class Methods

createWithContentOfFile

+ (LHScene *)createWithContentOfFile
Discussion

Returns a scene object with all the level elements loaded into Cocos2d-X.

Declared In
LHScene.h

Instance Methods

getGameWorldRect

- (Rect)getGameWorldRect
Discussion

Returns the game world rectangle or CGRectZero if the game world rectangle is not set in the level file.

Declared In
LHScene.h

assetInfoForFile

- (__Dictionary *)assetInfoForFile
Parameters
assetFileName

The name of the asset that. Do not provide an extension. E.g If file is named "myAsset.lhasset.plist" then yous should pass "myAsset.lhasset"

Return Value

A dictionary containing the asset information or nullptr.

Discussion

Returns the informations that can be used to create an asset dynamically by specifying the file name. The asset file must be in the same folder as the scene file. If the asset file is not found it will return nil.

Declared In
LHScene.h

createNodeObjectForSubclassWithName

- (LevelHelperNodeTypeSubclass)createNodeObjectForSubclassWithName
Parameters
subclassTypeName

The name of the your custom class.

lhTypeName

The name of the original LevelHelper node class type. Your class must be a subclass of this type.

Discussion

Overwrite this method to return your own class type for specific nodes. Setup the class type in "Subclass" property of LevelHelper 2. Check LHSceneNodesSubclassingDemo for how to use this method.

Your need to implement this function static YourClassType* nodeWithDictionary(LHDictionary* dict, Node* prnt); and overwrite this method virtual bool initWithDictionary(LHDictionary* dict, Node* prnt);

Declared In
LHScene.h

didFinishedPlayingAnimation

- (void)didFinishedPlayingAnimation
Discussion

Overwrite this method to receive notifications when an animation has finished playing a repetition.

Declared In
LHScene.h

didFinishedRepetitionOnAnimation

- (void)didFinishedRepetitionOnAnimation
Discussion

Overwrite this method to receive notifications when an animation has finished playing a repetition.

Declared In
LHScene.h

didCutRopeJoint

- (void)didCutRopeJoint
Discussion

Overwrite this method to receive notifications when a rope joint is cut.

Declared In
LHScene.h
Last updated: 2015-2-12

Back to top

Copyright © VLADU BOGDAN DANIEL PFA.