LHScene Reference

Inherits from
  • CCScene
Conforms to
LHScene.h

Overview

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

Instance Methods

backUiNode

- (LHBackUINode *)backUiNode
Discussion

Returns the back UI node. All children of this node will NOT move with the camera.

Declared In
LHScene.h

createNodeObjectForSubclassWithName:superTypeName:

- (Class)createNodeObjectForSubclassWithName:(NSString *)subclassTypeName superTypeName:(NSString *)superTypeName
Parameters
subclassTypeName

The name of the your custom class.

superTypeName

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 LHSceneNodesSubclassingTest for how to use this method.

Your need to implement this function

  • (instancetype)nodeWithDictionary:(NSDictionary*)dict parent:(CCNode*)prnt;

and overwrite this method

  • (instancetype)initWithDictionary:(NSDictionary*)dict parent:(CCNode*)prnt;

Declared In
LHScene.h

didCutRopeJoint:

- (void)didCutRopeJoint:(LHRopeJointNode *)joint
Discussion

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

Declared In
LHScene.h

didFinishedPlayingAnimation:

- (void)didFinishedPlayingAnimation:(LHAnimation *)anim
Parameters
anim

The animation object that just finished playing.

Discussion

Overwrite this method to receive notifications when an animation has finished playing. This method is called once, after all repetitions have finished playing.

Declared In
LHScene.h

didFinishedRepetitionOnAnimation:

- (void)didFinishedRepetitionOnAnimation:(LHAnimation *)anim
Parameters
anim

The animation object that just finished a repetition.

Discussion

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

Declared In
LHScene.h

gameWorldNode

- (LHGameWorldNode *)gameWorldNode
Discussion

Returns the game world node. All children of this node will move with the camera. For UI elements use the uiNode.

Declared In
LHScene.h

gameWorldRect

- (CGRect)gameWorldRect
Discussion

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

Declared In
LHScene.h

relativePath

- (NSString *)relativePath
Discussion

Returns the relative plist path that was used to load this scene information.

Declared In
LHScene.h

setAnimationNotificationsDelegate:

- (void)setAnimationNotificationsDelegate:(id<LHAnimationNotificationsProtocol>)del
Parameters
del

The object that implements the LHAnimationNotificationsProtocol methods.

Discussion

Set a animation notifications delegate for the cases where you don't need to subclass LHScene. When subclassing LHScene, if you overwrite the animation notifications methods make sure you call super if you also need the delegate support. If you delete the delegate object make sure you null-ify the animation notifications delegate.

Declared In
LHScene.h

textureWithImagePath:

- (CCTexture *)textureWithImagePath:(NSString *)imagePath
Parameters
imagePath

The path of the image that needs to get returned as a texture.

Return Value

An initialized CCTexture Object.

Discussion

Returns a CCTexture object that was previously loaded or a new one.

Declared In
LHScene.h

uiNode

- (LHUINode *)uiNode
Discussion

Returns the UI node. All children of this node will NOT move with the camera.

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

Back to top

Copyright © VLADU BOGDAN DANIEL PFA.