Search Unity

How to do responsive design

Discussion in 'Immediate Mode GUI (IMGUI)' started by steveg2357, Oct 16, 2014.

  1. steveg2357

    steveg2357

    Joined:
    Aug 21, 2014
    Posts:
    34
    Are there any examples of creating responsive GUI screens that allow controls (such as buttons) to be placed relative to other controls or the edges of the screen (the following is a nominal example)?

    ButtonScreen.jpg

    I know that rectangles can be created with coordinates relative to the screen size but I'd like to know if there's any way to do something like the following pseudocode, preferably in UnityScript.

    Code (JavaScript):
    1. Create centered row, anchor to SCREEN.BOTTOM
    2.   Create button "Done" named doneButton
    3.   Create button "Cancel" named cancelButton
    4. End create row
     
  2. Knskan3

    Knskan3

    Joined:
    Sep 1, 2014
    Posts:
    19
    Hi mate, you can use the tutorials about rect form and the live training regarding ui. You can achieve that by using panels and setting up the anchors and pivot points properly.

    The issue will come with the bug affecting the sharpenes of the fonts..