MelonGaming
»
Melon Editor
»
Game Editor
»
Change mouse cursor to pointer for button
Rank: Newbie
Groups: Registered
Joined: 11/27/2018(UTC) Posts: 0 Location: Oregon
|
I'm trying to change the mouse cursor to pointer/hand for button hover events. Code:
var userButton = me.GUI_Object.extend({
init: function(image, x, y, z, goToState) {
var settings = {};
settings.image = image;
this._super(me.GUI_Object, "init", [x, y, settings]);
this.pos.z = z;
this.goToState = goToState;
},
onClick: function(event) {
me.state.change(this.goToState);
// don't propagate the event
return false;
},
onOver: function(event){
document.body.style.cursor = "pointer";
},
onOut: function(event){
document.body.style.cursor = "default";
},
});
The above code works but is very slow and inconsistent. Is there a better method I should be using? thanks Dave
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/11/2019(UTC) Posts: 0 Location: aurangabd
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/6/2019(UTC) Posts: 0 Location: india
|
|
|
|
|
MelonGaming
»
Melon Editor
»
Game Editor
»
Change mouse cursor to pointer for button
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The MelonGaming uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close