Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17119

How to add sprite to menu

$
0
0

@jumpman8947 wrote:

I currently trying to write simple menu. So far i can add menu fonts to the menu, but when i try to add sprites, the sprites don't appear.

var normalImage = new cc.Sprite.create(res.tv_png);
var menuItem1 = new cc.MenuItemFont("Item1", hat);
var menuItem2 = new cc.MenuItemFont("Item2", jacket);
var item = cc.MenuItemSprite.create(normalImage);   
var menu = new cc.Menu(menuItem1,menuItem2,item);
menu.alignItemsVertically();
this.addChild(menu);

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17119

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>