[Spout] Get the GUI scale value

Discussion in 'Plugin Development' started by coldandtired, Oct 24, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    coldandtired

    Hi,

    The Minecraft screen always has the dimensions 427 x 240, but in the video settings there's an options to change the scale of the GUI - small, normal, large, or auto.

    This changes all the menu buttons and text on the menu.

    I've tried experimenting with the Spout API and can get the text resizing but I want everything to resize (automatically if possible). If it's not possible, how can I find out what the user has set the GUI scale to and calculate accordingly?

    @Afforess
     
  2. Offline

    Afforess

    Your widgets will scale automatically according to the GUI Scale. You can also fine tune the scaling with the ability to set anchors on widgets. Anchors basically set the point which a widget will scale around. For example, if the anchor is the top left corner of your, say, texture and the screen increases by 25%, then your texture becomes 25% larger, and in the 2 directions parallel to your widget, from the top left corner. This is easiest to think about with a grid, and keep in mind the upper left corner of the screen is 0,0. (Don't ask me why...OpenGL decided...)
     
  3. Offline

    coldandtired

    Thanks for the reply.

    I'm still having problems with it. I'm very familiar with XAML's layout but this one is a little different.

    So if I want a row of buttons of which five will fit on the large scaling, but eight (say) on the normal scaling, would that work?

    Also, from what I can tell, there's no easy way to make widgets wrap in a Container, is that right?
     
Thread Status:
Not open for further replies.

Share This Page