Hi!
I have to put a scrollbar on a menu of my game, look:
http://img535.imageshack.us/img535/2720/semttulofub.png
On screen, it is only 18 images, with a scrollbar would like, could be placed more pictures.
How do I do that?
Scrollbar in DirectX
Are you asking how to make a scrollbar control with Direct3D? What version of DirectX are you using? What part exactly are you having trouble with?
A scrollbar would take weeks to make from scratch and might confuse the player.
The best looking solution would be to divide levels into chapters so that you turn a page by clicking on a "previous" or "next" button.
If you have the time to make a scrollbar, make a class with draw, scroll up, scroll down, hover, press and release calls. The class will allocate and draw a vertical background, up and down button images that changes from hover and pressing and a rectangle showing the interval of lines visible. To make smooth scrolling, render all level images with a screen projected alpha multiplying texture to clip away images outside of their area. Use a fast culling method to only draw from the first to the last visible level image.
Remember that you can use as much dynamic object orienting as you want because GUI is not a performance bottleneck. Make sure that you can reuse all GUI code and modify the look for your next games.
The best looking solution would be to divide levels into chapters so that you turn a page by clicking on a "previous" or "next" button.
If you have the time to make a scrollbar, make a class with draw, scroll up, scroll down, hover, press and release calls. The class will allocate and draw a vertical background, up and down button images that changes from hover and pressing and a rectangle showing the interval of lines visible. To make smooth scrolling, render all level images with a screen projected alpha multiplying texture to clip away images outside of their area. Use a fast culling method to only draw from the first to the last visible level image.
Remember that you can use as much dynamic object orienting as you want because GUI is not a performance bottleneck. Make sure that you can reuse all GUI code and modify the look for your next games.
Scrollbar in weeks??
A whole GUI system can be written from scratch in weeks (for a game at least).
You need to render the scrollbar, you need to detect mouse click (a few point in rectangle check), you need to write a functions for the separate areas (if you want it to be real fancy, one clickable area would suffice too). Those functions are very simple functions: Moving the slider, and converting the slider coordinates to page coordinates.
That's pretty much it.
A whole GUI system can be written from scratch in weeks (for a game at least).
You need to render the scrollbar, you need to detect mouse click (a few point in rectangle check), you need to write a functions for the separate areas (if you want it to be real fancy, one clickable area would suffice too). Those functions are very simple functions: Moving the slider, and converting the slider coordinates to page coordinates.
That's pretty much it.
Quote:Original post by Evil Steve
Are you asking how to make a scrollbar control with Direct3D? What version of DirectX are you using? What part exactly are you having trouble with?
Yes, i'm using the DirectX 9.c
I do not know where to start, Direct3D supports the scrollbar? or have to use a lib?
Thanks
Quote:Original post by VitaliBRDirectX is just a rendering API, it doesn't support anything as high level as that. You could use DXUI or some other UI toolkit, or if you want to implement it yourself you'll need to start from scratch - render each part of the scrollbar as a separate object and handle input yourself.
I do not know where to start, Direct3D supports the scrollbar? or have to use a lib?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement