Unity Community


Results 1 to 5 of 5

  1. Location
    Alabama
    Posts
    939

    ScrollView problems

    I'm using a ScrollView with a GUILayout and I'm wondering if there is anyway to tell if the user is scrolled all the way to the bottom at any point? I know you can access the y position of the Vector2 you pass to the GUILayout.BeginScrollView() function, but I'm not sure how to determine if the user is scrolled all the way to the bottom of the scroll view.

    Any help is appreciated.


  2. Location
    Alabama
    Posts
    939
    Bump. I haven't found a good fix for this.


  3. Location
    Orlando, FL
    Posts
    724
    Looked at this for a little bit, but there's not much you do with the scrollPosition.y because it just tells you the y position of the scrollbar, what you need to know is how much content there is to show in the window, and there's not a variable for that.

    If you knew the content size, then you could deduce the relative position of the scrollbar by using the window height and scrollPosition.y.
    No more Tiled Textures! - Vertex Painter with blend shaders for painting meshes
    [ Vertex Painter 2 released! ] with desktop and mobile blend shaders:
    --> Click Here <--
    Also Available on the Unity Asset Store
    --> Click Here <--


  4. Location
    GMA950
    Posts
    3,031
    You should be able to get the content height by using GetLastRect() after the last piece of content. Add the y and height components of the Rect and see what you get.


  5. Location
    Alabama
    Posts
    939
    Thanks! I will try that. Hopefully the fact that it happens during the repaint event won't affect anything. I'll see how this goes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •