Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ScrollbarMouseWheel = pc.createScript('scrollbarMouseWheel');
- ScrollbarMouseWheel.attributes.add('steps', {
- type:'number'
- });
- // initialize code called once per entity
- ScrollbarMouseWheel.prototype.initialize = function() {
- this.scrollbar = this.entity.scrollbar;
- this.app.mouse.on(pc.EVENT_MOUSEWHEEL, this.onMouseWheel, this);
- };
- ScrollbarMouseWheel.prototype.onMouseWheel = function(event) {
- //console.log("val:"+event.wheelDelta);
- this.scrollbar.value = this.scrollbar.value += (event.wheelDelta * this.steps);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement