Sign in to follow this  
JohnK

GUI ScrollViewer

Recommended Posts

Something like this:

canvas.addEventListener("wheel", (evt) => { 
	if(this.slider[name].isVisible == true) {
		if(evt.deltaY < 0 && this.slider[name].value >= 0) {
			this.slider[name].value -= 50;
		} else if(evt.deltaY > 0 && this.slider[name].value < this.slider[name].maximum) {
			this.slider[name].value += 50;
		}  
	}
}, false);

 

Share this post


Link to post
Share on other sites

This is a dirty way of doing it https://www.babylonjs-playground.com/#3EF49E#1 will have to do more studying to add "wheel" code into the source code as observables and events are one of my many weak points.

Note that for both sliders the range is 0 to 100 from which the amount to scroll the viewer window is then calculated. You can guess the name of the horizontal bar 🙂😎🙂

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.