Where to use MenuItems and Buttons also what is the difference !!

Cocos2d-x v3
  • pabitrapadhy
    Likes 1

    Problem Description

    Hello,

    I have been using a lot of menu item images, almost for everything.
    Like, If have have to go from one scene to another also then also I use a MenuItemImage, say almost for everything.

    I never used an UI element unless it comes to Editbox, ScrollView, and such.
    Could you guide me where to use which one.. ??

    Also, if you could tell what is the performance advantage of one over another at certain scenarios ?
    If any other details you want to share, I would greatly welcome that.

    Regards

  • Sonar Systems admin
    Likes 0

    UI items are newer and have there own touch listeners, check this out for more information http://www.cocos2d-x.org/wiki/UI

  • barabasandras1
    Likes 1

    UI items are just great. For buttons addTouchEventListener function is much more faster and safer for example.

  • efares
    Likes 0

    Hey, can anyone tell me the difference/benefits of using MenuItemsSprite vs MenuItemImage?
    And from what I read here I guess UI items are better to use now?


  • pabitrapadhy
    Likes 0

    I know both can be used as buttons,
    but why ui::Button and why not MenuItemImage

    I want to know the technical stuffs behind the use and the context they are used in.

  • Sonar Systems admin
    Likes 0

    UI items work with other UI items such as containers like UILayout hence why you would use UI items.

     

    MenuItemImage has less overheard compared to a sprite but realistically nothing to worry about.

  • efares
    Likes 0

    So UIButtons, MenuItemIamge and MenuItemSprite can all be used to make buttons and have very little differences, right? In terms of performance and ease of manipulation (Ex: placing a button on the bottom left of the screen) it’s the same for all?

    So how do you decide which method to use?


  • Sonar Systems admin
    Likes 0

    Generally just use UIButton as its newer and will most likely be supported more.

Login to reply