Cursor pointer

Can anyone tell me how to make a cursor visual pointer on some element hover?
Has invited:

QC-Cindy

Favor from: george828

1、You can do like this, the code is shown as below:
// define a user behaviour
var Pointer = qc.defineBehaviour('qc.demo.Pointer',qc.Behaviour,function(){
//save old mouse style
this.oldCursor = '';
},{

});
// Called when the script instance is being loaded.
Pointer.prototype.awake = function(){

var self = this;

// listen the mouse into target area
self.addListener(self.gameObject.onEnter,function(){

//save old mouse style
self.oldCursor = document.body.style.cursor;

//set the mouse style to be pointer
document.body.style.cursor="pointer";
});

//listen the mouse leave target area
self.addListener(self.gameObject.onExit,function(){

//restore the old mouse style
document.body.style.cursor = self.oldCursor;
});
};
Runtime, rendering as below,


1.gif


 
2、If it is Dom node,you can add the code as below in css/style.css:
.cs{
cursor: pointer;
}
Runtime, rendering as below,


2.gif

 

To reply to a question, please Login or registered