Hi all,
Did anyone ever done a complex MenuItem - a menu item composed of one or more images, text, etc.
I've been looking into it but seem to be missing something. Is it possible?
Thanks!
A fast, easy to use, free, and community supported 2D game engine
Hi all,
Did anyone ever done a complex MenuItem - a menu item composed of one or more images, text, etc.
I've been looking into it but seem to be missing something. Is it possible?
Thanks!
I'm having exactly the same problem:
I tried this in two ways:
1. extending CCMenuItemImage and add a CCLabel on top of that image (namely I want to create buttons where some text is on top of a rounded button); but the label positioning is totally messed up: it's not related to the imageitem's position, instead it's related to the parent layer one; which is not what I want, at all.
2. extending CCMenuItemSprite and have CCSprites to which I'd add CCLabel as child. But this has no visible effect - turns out CCLabels added as children to CCSprites will not be displayed.
Any ideas? Suggestions?
I assume you want a menu where you click a button and a sub menu comes up with more buttons? If so, you could have your main menu. Then for each button you create your sub menu (just another menu) positioned relative to each menuitem but hide it. When you click the button, you show the sub menu. Or you could create the submenu on the fly, but its going to be slower. You don't have to worry about children, just position relative to main menuitem. I would be surprised if this didn't work.
BTW, Hi Joao. Haven't seen you around much lately.
It seems you are talking about this issue:
http://code.google.com/p/cocos2d-iphone/issues/detail?id=458&colspec=ID%20Type%20Status%20Priority%20Milestone%20Component%20Owner%20Summary
I've manage to apply it's diff to the last version, and it's working. I can now use a CCSprite with childs inside.
If that's the case, you can contact me directly and I'll send you the changed classes.
leocck at gmail
I'm not sure about Joao's intentions. What I am looking for is a way to have a menu where the menuitems are nodes with children (instead of single nodes like now); in particular, as menuitems I want a node made of a cclabel placed over a ccsprite ; ideally, we could have actions take place on the background sprite, or the foreground label, etc...
@leocck exactly, that is the issue I have... I'll email you for that piece of code and try to create a new subclass of CCNode to do it :)
@jd Hi! :) yeah, started teaching at a local university so I don't have all the time I use to have for this... :) but I'm now trying to get back to the forum on a regular basis
Hey, I seem to be having the same issues as Joao, but with cocos2d 0.99.3. What is the best, or atleast a good way, to create a CCMenuItemSprite button that consists of 3-4 random elements? I checked the link leocck posted and looked at the diff file linked there, but since it was for an older version of cocos2d, didn't know what to change.
Pondering on just making a normal CCSprite that'll do the same thing as the CCMenuItemSprite and let that CCSprite handle it's own touches and logic. Though, I'd still love to use the CCMenuItemSprites, since all the needed functionality (par the drawing of childs) is in there :)
Any recomendations are welcomed.
You must log in to post.