Show / Hide Table of Contents

Class GUILayout

The interface for GUI with automatic layout.

Inheritance
System.Object
GUILayout
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:ImGui
Assembly:ImGui.dll
Syntax
public class GUILayout

Methods

| Improve this Doc

BeginHorizontal(LayoutOption[])

Begin a horizontal layout group.

Declaration
public static void BeginHorizontal(params LayoutOption[] options)
Parameters
Type Name Description
LayoutOption[] options
| Improve this Doc

BeginVertical(LayoutOption[])

Begin a vertical layout group.

Declaration
public static void BeginVertical(params LayoutOption[] options)
Parameters
Type Name Description
LayoutOption[] options
| Improve this Doc

Button(String, String, LayoutOption[])

Create an auto-layout button. When the user click it, something will happen immediately.

Declaration
public static bool Button(string text, string id, params LayoutOption[] options)
Parameters
Type Name Description
System.String text

text to display on the button

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

Returns
Type Description
System.Boolean

true when the users clicks the button.

| Improve this Doc

EndHorizontal()

End a horizontal layout group.

Declaration
public static void EndHorizontal()
| Improve this Doc

EndVertical()

End a vertical layout group.

Declaration
public static void EndVertical()
| Improve this Doc

ExpandHeight(Boolean)

Set whether the height of a control should be expanded to occupy as much space as possible.

Declaration
public static LayoutOption ExpandHeight(bool expand)
Parameters
Type Name Description
System.Boolean expand

expanded?

Returns
Type Description
LayoutOption

A LayoutOption that will expand the height of a control/group.

| Improve this Doc

ExpandWidth(Boolean)

Set whether the width of a control should be expanded to occupy as much space as possible.

Declaration
public static LayoutOption ExpandWidth(bool expand)
Parameters
Type Name Description
System.Boolean expand

expanded?

Returns
Type Description
LayoutOption

A LayoutOption that will expand the width of a control/group.

| Improve this Doc

FlexibleSpace()

Put a expanded space inside a layout group.

Declaration
public static void FlexibleSpace()
| Improve this Doc

Height(Double)

Set the height of a control.

Declaration
public static LayoutOption Height(double height)
Parameters
Type Name Description
System.Double height

height value

Returns
Type Description
LayoutOption

A LayoutOption that will set the height of a control/group.

| Improve this Doc

HoverButton(String, String, LayoutOption[])

Create an auto-layout button that will be actived when the mouse is over it.

Declaration
public static bool HoverButton(string text, string id, params LayoutOption[] options)
Parameters
Type Name Description
System.String text

text to display on the button

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

Returns
Type Description
System.Boolean

whether it is activated (the mouse is over it)

| Improve this Doc

Image(String, String, LayoutOption[])

Create an auto-layout image.

Declaration
public static void Image(string filePath, string id, params LayoutOption[] options)
Parameters
Type Name Description
System.String filePath

file path of the image to display. The path should be relative to current dir or absolute.

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

| Improve this Doc

Label(String, String, LayoutOption[])

Create an auto-layout label.

Declaration
public static void Label(string text, string id, params LayoutOption[] options)
Parameters
Type Name Description
System.String text

text to display on the label

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

| Improve this Doc

PolygonButton(IReadOnlyList<Point>, Rect, String, String, LayoutOption[])

Create an auto-layout polyon-button.

Declaration
public static bool PolygonButton(IReadOnlyList<Point> points, Rect textRect, string text, string id, params LayoutOption[] options)
Parameters
Type Name Description
System.Collections.Generic.IReadOnlyList<Point> points

Point list of the polygon.

Rect textRect

the rect that occupied by the text

System.String text

text to display on the button

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

Returns
Type Description
System.Boolean

true when the users clicks the button.

| Improve this Doc

Slider(Size, Double, Double, Double, String, LayoutOption[])

Create an auto-layout horizontal slider that user can drag to select a value.

Declaration
public static double Slider(Size size, double value, double minValue, double maxValue, string id, params LayoutOption[] options)
Parameters
Type Name Description
Size size

size of the slider

System.Double value

The value the slider shows.

System.Double minValue

The value at the left end of the slider.

System.Double maxValue

The value at the right end of the slider.

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

Returns
Type Description
System.Double

The value set by the user.

Remarks

minValue <= value <= maxValue

| Improve this Doc

Space(Double)

Put a fixed-size space inside a layout group.

Declaration
public static void Space(double pixels)
Parameters
Type Name Description
System.Double pixels

size of the space

| Improve this Doc

StretchHeight(Int32)

Set the factor when expanding the height of a control.

Declaration
public static LayoutOption StretchHeight(int factor)
Parameters
Type Name Description
System.Int32 factor

the value of the factor

Returns
Type Description
LayoutOption

A LayoutOption that will set the factor when expanding the height of a control/group.

| Improve this Doc

StretchWidth(Int32)

Set the factor when expanding the width of a control.

Declaration
public static LayoutOption StretchWidth(int factor)
Parameters
Type Name Description
System.Int32 factor

the value of the factor

Returns
Type Description
LayoutOption

A LayoutOption that will set the factor when expanding the width of a control/group.

| Improve this Doc

Toggle(Boolean, String, LayoutOption[])

Create an auto-layout toggle (check-box).

Declaration
public static bool Toggle(bool value, string id, params LayoutOption[] options)
Parameters
Type Name Description
System.Boolean value

Is this toggle checked or unchecked?

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

Returns
Type Description
System.Boolean

new value of the toggle

| Improve this Doc

ToggleButton(String, Boolean, String, LayoutOption[])

Create an auto-layout button that acts like a toggle.

Declaration
public static bool ToggleButton(string text, bool value, string id, params LayoutOption[] options)
Parameters
Type Name Description
System.String text

text to display on the button

System.Boolean value

Is this toggle checked or unchecked?

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

Returns
Type Description
System.Boolean

new value of the toggle-button

| Improve this Doc

VSlider(Size, Double, Double, Double, String, LayoutOption[])

Create an auto-layout vertical slider that user can drag to select a value.

Declaration
public static double VSlider(Size size, double value, double minValue, double maxValue, string id, params LayoutOption[] options)
Parameters
Type Name Description
Size size

size of the slider

System.Double value

The value the slider shows.

System.Double minValue

The value at the top end of the slider.

System.Double maxValue

The value at the bottom end of the slider.

System.String id

the unique id of this control

LayoutOption[] options

layout options that specify layouting properties. See also Width(Double), Height(Double), ExpandWidth(Boolean), ExpandHeight(Boolean), StretchWidth(Int32), StretchHeight(Int32)

Returns
Type Description
System.Double

The value set by the user.

Remarks

minValue <= value <= maxValue

| Improve this Doc

Width(Double)

Set the width of a control.

Declaration
public static LayoutOption Width(double width)
Parameters
Type Name Description
System.Double width

width value

Returns
Type Description
LayoutOption

A LayoutOption that will set the width of a control/group.

  • Improve this Doc
Back to top Copyright © 2016 zwcloud
Generated by DocFX