@Nexus6 : thanks for helping and guiding me.
level making in cocos2d
(33 posts) (11 voices)-
Posted 3 months ago #
-
Wouldn't be any other possibility to place the sprites on the layer programmatically?
I was thinking to add them like this:
+(id) initWithParentNode:(CCNode *)parentNode activationState:(BOOL)EnableState withPicture:(NSString *)picture withSound:(NSString *)sound withText:(NSString *)text objectState:(BOOL)isFound xCoord:(int) xAxis yCoord:(int) yAxis selectAnimation:(NSString *)selectAnAnimation zOrder:(int) zOrder tagIdentifier:(int) kIdentifier { return [[[self alloc] initWithParentNode:parentNode activationState:EnableState withPicture:picture withSound:sound withText:text objectState:isFound xCoord:xAxis yCoord:yAxis selectAnimation:selectAnAnimation zOrder:zOrder tagIdentifier:kIdentifier] autorelease]; } -(id)initWithParentNode:(CCNode *)parentNode activationState:(BOOL)EnableState withHisImage:(NSString *)picture withHisSound:(NSString *)sound withHisText:(NSString *)text objectHisState:(BOOL)isFound xCoord:(int) xAxis yCoord:(int) yAxis selectAnAnimation:(NSString *)selectAnAnimation zOrder:(int) zOrder tagIdentifier:(int) kIdentifier { if ((self = [super init])) { [parentNode addChild:self]; objectItem = [[CCMenuItemSprite itemFromNormalSprite:[CCSprite spriteWithSpriteFrameName:picture] selectedSprite:[CCSprite spriteWithSpriteFrameName:picture] target:self selector:@selector(aMethod:)] retain]; objectItem.isEnabled = EnableState; [objectItem setPosition: ccp(xAxis,yAxis)]; [objectItem setAnchorPoint: ccp(0,0)]; menuObject = [CCMenu menuWithItems:objectItem, nil]; [menuObject setPosition: ccp(xAxis,xAxis)]; [self addChild:menuObject z:zOrder tag:kIdentifier]; [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:-1 swallowsTouches:YES]; } return self; }any tip that could help me in my situation?
Posted 3 months ago # -
Hey Guys, Need One more help
If i import any image in svg file. means if i use any image as background in svg file then how to display this image in simulator?
Posted 3 months ago #
Reply
You must log in to post.