GUI sprites not children of spritesheet

Forums Programming cocos2d support (graphics engine) GUI sprites not children of spritesheet

This topic contains 1 reply, has 2 voices, and was last updated by  Gillies 2 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
Author Posts
Author Posts
November 10, 2011 at 11:25 am #236768

FBryant
Participant
@fbryant

I have quite a complex GUI with lots of buttons and menus etc. All the sprites making up this interface all come from the same spritesheet, but are of course not children of a CCSpriteBatchNode.

Is there any performance benefit with this setup, and is there anything I can do to improve it? For each button, I make a CCSprite and then make a CCMenuItemSprite from the sprite, so there’s no opportunity for me to add anything to a spritesheet is there?

November 10, 2011 at 10:40 pm #354229

Gillies
@gillies

You can’t add menu items to a batch node, so you will not be able to batch render the buttons by default.

Of course you could derive your own button class from CCSprite if performance was an issue.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.