Aram Posted June 25, 2018 Share Posted June 25, 2018 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 More sharing options...
prob Posted June 25, 2018 Share Posted June 25, 2018 You can include it in the setInteractive config: .setInteractive( { useHandCursor: true } ); Link to comment Share on other sites More sharing options...
scope2229 Posted June 25, 2018 Share Posted June 25, 2018 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 More sharing options...
Aram Posted June 26, 2018 Author Share Posted June 26, 2018 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 More sharing options...
Recommended Posts