Jump to content

Scrollbar value


Mr.Loki

Recommended Posts

OK, so this is my setup:

u9EVnhE.png

I've modified the scrollbar so that it scrolls from 0 to 1 instead of 100

Is it possible apply the minimum(-33) and the max(64) to the scrollbar so that 0 = min of -33 and 1 = max of 64?

 

local scrollPos = guiScrollBarGetScrollPosition

windw = guiCreateWindow(143, 305, 673, 170, "", false)
guiWindowSetSizable(windw, false)
sbar = guiCreateScrollBar(86, 33, 501, 51, true, false, windw)
min = guiCreateEdit(9, 33, 88, 51, "-33", false, windw)
max = guiCreateEdit(578, 33, 88, 51, "64", false, windw)
result = guiCreateEdit(297, 89, 88, 51, "-33", false, windw)
showCursor( true )
addEventHandler( "onClientRender", root, 
    function ( )
        local pos = (scrollPos(sbar) / 100)
        guiSetText(result,pos)
    end 
)

 

I suck at math. ._.

Edited by loki2143
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...