Jump to content
  • Advertisement
Sign in to follow this  
AnotherFalseProphet

GUI Design tricks

This topic is 2610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone!
I've been writing a reusable GUI library for myself to use in some projects to make designing a game a bit easier. I've been writing a function that creates a scroll box that should function like a normal scroll bar, however I am not quite sure as to what functions I need to do to capture that true scrolling when clicked feel. I've tried Mouse Delta but it just seems to push the scroll bar instead of having the scroll bar itself follow the mouse.

Any ideas?

Share this post


Link to post
Share on other sites
Advertisement

Hello everyone!
I've been writing a reusable GUI library for myself to use in some projects to make designing a game a bit easier. I've been writing a function that creates a scroll box that should function like a normal scroll bar, however I am not quite sure as to what functions I need to do to capture that true scrolling when clicked feel. I've tried Mouse Delta but it just seems to push the scroll bar instead of having the scroll bar itself follow the mouse.

Any ideas?


What I do is store the XY position of the mouse on mouse down, and on each mouse move get new coords and subtract from the stored position to get the delta position. I then adjust scroll bars button position by that delta.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!