Jump to content

show hand cursor on mouse over


Aram
 Share

Recommended Posts

Hi all,

I am developing my own button class, and can't find how to change cursor to "hand" when the pointer is over button, is there an automatic way? or I should handle over set to hand, and then set to default again in out handler?

Thank You

Link to comment
Share on other sites

for mine i had an image that was used for the background of my button so i used this

let xWing = this.add.sprite(150, 150, 'xWing1').setInteractive({ cursor: 'pointer' })

you should be able to do the same with your button just not with a sprite.

Link to comment
Share on other sites

Thank you Guys!

unfortunately setInteractive doesn't have config prop in version 3.9.0 :)

 

 

/**
 * Pass this Game Object to the Input Manager to enable it for Input.
 * @param shape A geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.
 * @param callback A callback to be invoked when the Game Object is interacted with.
 * @param dropZone Should this Game Object be treated as a drop zone target? Default false.
 */
setInteractive(shape?: any, callback?: HitAreaCallback, dropZone?: boolean): Phaser.GameObjects.GameObject;
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...