Enigma666 Posted May 6, 2014 Share Posted May 6, 2014 Hi, What i want to make is a list, that can only draw out, for example 15 players. If i scroll down, one less at top, and one new comes at the bottom, so basically just like how scoreboards work. I know the required events and all that. Ive been having this problem for a while and couldnt figure it out. Thanks. Link to comment
Gallardo9944 Posted May 6, 2014 Share Posted May 6, 2014 Add a variable called "offset" and increase/decrease with when you move the mouse wheel. Link to comment
Enigma666 Posted May 6, 2014 Author Share Posted May 6, 2014 How does that help me at all?.. Link to comment
Gallardo9944 Posted May 6, 2014 Share Posted May 6, 2014 Use it in rendering as positioning. Link to comment
Karuzo Posted May 6, 2014 Share Posted May 6, 2014 How does that help me at all?.. If a player uses the "mouse_down" "key" you could make offset = offset - 10. If a player uses the "mouse_up" key you could make offset = offset + 10. You have to do some maths to do this, and you also have to calculate where it should stop, otherwise it would go out of the scoreboard or will show a blank scoreboard ^^ Link to comment
Enigma666 Posted May 6, 2014 Author Share Posted May 6, 2014 That is exactly what i need. The rendering part. [yep, failed at maths last year] Link to comment
Enigma666 Posted May 6, 2014 Author Share Posted May 6, 2014 Wel, i have no idea how to do it. Link to comment
Gallardo9944 Posted May 7, 2014 Share Posted May 7, 2014 Anyone? local offset = 0 -- offset should be 0 by default function scoreScroll(side) if side == "mouse_wheel_down" then offset = offset + 10 -- scroll down elseif side == "mouse_wheel_up" then offset = offset - 10 -- scroll up end end bindKey("mouse_wheel_up","down",scoreScroll) bindKey("mouse_wheel_down","down",scoreScroll) --Later in your rendering part dxDrawText(text,px,py+offset,sx,sy,...) -- render, including scroll Link to comment
Enigma666 Posted May 7, 2014 Author Share Posted May 7, 2014 Yes, im aware of the moving part, its just the rendering part, which im not really aware of. The basic idea is a list, on scroll one less shows at top, and one more shows up at bottom. I dont think that this offset way does that. Link to comment
Gallardo9944 Posted May 7, 2014 Share Posted May 7, 2014 It does if you add more checks before actually drawing and moving. Link to comment
Enigma666 Posted May 7, 2014 Author Share Posted May 7, 2014 Well i have basically no idea what you are talking about really.. lol Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now