Hi, Im currently trying to develop a game utilizing the Irrlicht engine. I am still in the initial programming phases where I am creating my own menu system. The problem I have run into is one of understanding the class irr::gui::IGUIScrollBar. Within this class there are member functions for getting the absolute and relative position that are inherited from the IGUIElement class. I am trying to set a default position for the scroll bar rectangle (the interactive part, excuse me for not having a better term). It is important to understand that I do not want to simply set the position of the whole scroll bar, rather I would like to have the user be able save his/her settings so that the scroll bar rectangle is always at that position whenever they play their game. I think this problem could be cleared up if I knew exactly what the functions: IGUIScrollBar->setRelativePosition() and IGUIScrollBar->setAbsolutePosition() do and why they are different.
Id like to ask for your help on this, as I have tried researching this by looking at the header files and on the API.NET with no success. If you have any suggestions, comments, etc. please feel free to email me or post here. You can reach me at: meyemh30@yahoo.com
IGUIScrollBar problem
these might help.
gui::IGUIScrollBar* scrollbar = env->addScrollBar(0,rect<s32>(0,0,10,10));
//for this example first param = bool Horizontal, Rectangle.
scrollbar->setMax(255); //max number of scrollbar positions
s32 userpos = 3; //or another variable
scrollbar->setPos(userpos); //sets the position of the scrollbar
This is different for listboxes thats another headache.
gui::IGUIScrollBar* scrollbar = env->addScrollBar(0,rect<s32>(0,0,10,10));
//for this example first param = bool Horizontal, Rectangle.
scrollbar->setMax(255); //max number of scrollbar positions
s32 userpos = 3; //or another variable
scrollbar->setPos(userpos); //sets the position of the scrollbar
This is different for listboxes thats another headache.
Just one question, are you talking about the position of the entire scroll bar ( the up and down buttons, the little square etc) or are you refering to just the square that determines the current value of the scroll bar?
The set relative and set absolute position affect the position of the entire scrollbar on the screen. To set the value of the bar, and hence the position of just the rectangle use the setpos function from Midnights example.
The set relative and set absolute position affect the position of the entire scrollbar on the screen. To set the value of the bar, and hence the position of just the rectangle use the setpos function from Midnights example.
-
- Posts: 2
- Joined: Thu Sep 08, 2005 11:29 pm