2 – Root In Depth

In iGUI every scene must have a root. You can think root as the main container. You can add a root to the scene by clicking on the house icon at the right top of the toolbox. Before adding a root, the scene must have been saved. Because iGUI will create a codefile for the event system, which will contain event methods for the scene. And the name of this code file will have the naming convention of iGUICode_sceneName. The generated iGUICode file lives on the root. Every reference injection like a ball in the scene to the iGUICode script can be done here.


GUI Skin

The Gui Skin property is used as a reference for newly created elements in the scene. When an item is created for the first time, it gets a copy of the corresponding style from this skin. So when you change the Gui Skin property, the elements which are currently on the scene will remain same and look like the elements of previous skin and the new elements you create will get their styles from the new skin that you assign. You can use the built in unity skin just by setting the Gui Skin property to none. Also you can use any custom unity GUISkin file you desire. In iGUI skin files normal and retina, there are many custom styles along with the standart styles. iGUI will search for the custom styles in the Gui Skin file you provided with their names and if can’t find the custom one, picks a similar standart one if possible. For example when you are using a custom skin, when you add a checkbox group and set its type to Radio, iGUI will search for a GUIStyle named Radio in the custom styles of your GUISkin. If can’t find it, iGUI will use the standart toggle style for the radio type.

Allowed Screen Orientations

Allowed Screen Orientations is a property that can be used only for devices like iPhone. It holds a list of allowed screen orientations. If the device’s orientation match one of the orientations in this list iGUI will automatically switch to that screen orientation. Also if you designed your gui relatively, all iGUI elements will resize automatically. If the list is empty iGUI won’t switch to any screen orientation.

Auto Refresh On Resolution Change

If checked Auto Refresh On Resolution Change property refreshes all elements automatically when a screen resolution change noticed. All relative elements will resize and reposition when the root refreshes. You can manually refresh the root with root1.refresh() method.


Tooltip Icon

Tooltip icon is optional. If you supply a texture, it will display on tooltips of all elements. In the image above you can see an example of tooltip icon.

Tooltip Appear Time

Tooltip Appear Time indicates the time in seconds how much will the mouse wait on an element to make tooltip appear. You can disable tooltips completely by setting zero as Tooltip Appear Time value.

On Resolution Change

Resolution Change event fires when the screen resolution changes.

Tooltip Render Strategy

Tooltip Render Strategy is used to determine whether the tooltips will be drawn as a window(over all other elements) or plain label.

Manual Code File

Manual Code File property is used to enable developers to bind any iGUICode file manually. This is useful to share the same code file between scenes.

Alert Styles (Window, Button, Label)

Alert Styles property is used to fine tune the visual appearance of the built in alert windows which can be popped with iGUIRoot.alert(“Title”, “Content”) method.

Mouse Cursor

Mouse Cursor property is used to replace the mouse cursor with a texture.

Mouse Cursor Size

Mouse Cursor Size property is used to determine the size of mouse cursor. Can be relative (0, 2) or absolute ( >2 ). If equals to Vector2.zero, the image will be drawn with its original size.

Mouse Cursor Scale Mode

Mouse Cursor Scale Mode property is used to determine the scale mode of mouse cursor texture.

Mouse Cursor Aspect Ratio

Mouse Cursor Aspect Ratio property is used to force the aspect ratio of mouse cursor texture. If set to zero, will be ignored.

Cursor Tip Offset

Cursor Tip Offset property is used to match the tip of the cursor image with actual mouse position. Relativeness or absoluteness is determined by the relativeness of mouseCursorSize.