LHAsset Reference

Inherits from
  • CCNode
Conforms to
LHAsset.h

Overview

LHAsset class is used to load an asset object from a level file or from the resources folder.

Class Methods

createWithName:assetFileName:parent:

+ (instancetype)createWithName:(NSString *)assetName assetFileName:(NSString *)fileName parent:(CCNode *)prnt
Parameters
assetName

The name of the new asset node. Can be used later to retrieve the asset from the children hierarchy.

fileName

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

prnt

The parent node. Must not be nil and must be a children of the LHScene (or subclass of LHScene).

Return Value

A new asset node.

//this is how you should use this function
LHAsset* asset = [LHAsset createWithName:@"myNewAsset" assetFileName:@"OfficerAsset.lhasset" parent:[self gameWorldNode]];
asset.position = CGPointMake(110,40);

Discussion

Creates a new asset node with a specific name.

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

Back to top

Copyright © VLADU BOGDAN DANIEL PFA.