Jump to content

Scrolling


Recommended Posts

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
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
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...