just like the onmouseover in html,
var myItembx = cc.MenuItemImage.create(
imageNormal,
imageSelected,
function () {
……….
},pointer);
the MenuItemImage can trigger a function but it need to click it,is there anyway when the mouse over the item that could trigger a function?
ShunLin
#2
If you want to use onMouseOver for button, you need to detect the collision of the button and mouse every frame. It should be implemented by yourself.
Shun Lin wrote:
If you want to use onMouseOver for button, you need to detect the collision of the button and mouse every frame. It should be implemented by yourself.
Thanks but i still do not understand how to judge a collision between a sprite and mouse,two sprite maybe ok.