Jump to content

gui-Set/Get-Horizontal/Vertical-ScrollPosition


Deltanic

Recommended Posts

The source of this code shows me that it uses a percentage. Strange thing is, using 50 won't place it in the middle, while 100 DOES keep it at the bottom. Or does this only work when the scrollpane is filled enough?

My test: I've made a gui window, and a scrollpane in it. Then, everytime I want I fill that scrollpane with a label. When there are enough labels, you are able to scroll ofcourse. But the scrollbar won't be set to 50%. It's first around 95. Then I add a new label, and it's around 90%. That goes on like that, until 50%. After 10000 labels, it works...

It's probably my script, so let me give a part of it:

  
--This script is going to be rescripted, since this one has relative arguments and I'm going to use absolute arguments. 
local labelLine = 0.0 
function outputHandlingLog ( logText ) 
    -- handlingEditor_LogPane = scrollpane inside gui 
    local logLabel = guiCreateLabel ( 0.18, labelLine, 0.82, 0.2, logText, true, handlingEditor_LogPane ) 
    labelLine = labelLine + 0.1 -- Next label needs to be lower 
    guiScrollPaneSetVerticalScrollPosition ( handlingEditor_LogPane, 50 ) 
end 
  

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