raygui

package module
v0.0.0-...-bcf0fc4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2025 License: Zlib Imports: 11 Imported by: 0

README

raygui GoDoc

raygui is simple and easy-to-use IMGUI (immediate mode GUI API) library.

controls_test_suite

Demo

scroll_panel

Demo

Documentation

Index

Constants

View Source
const (
	SCROLLBAR_LEFT_SIDE = iota
	SCROLLBAR_RIGHT_SIDE
)
View Source
const (
	// Slider size of internal bar
	SLIDER_WIDTH int32 = 16
	// Slider/SliderBar internal bar padding
	SLIDER_PADDING = 17
)
View Source
const (
	ARROWS_SIZE int32 = iota + 16
	ARROWS_VISIBLE
	SCROLL_SLIDER_PADDING
	SCROLL_SLIDER_SIZE
	SCROLL_PADDING
	SCROLL_SPEED
)
View Source
const (
	// ComboBox right button width
	COMBO_BUTTON_WIDTH int32 = 16
	// ComboBox button separation
	COMBO_BUTTON_SPACING = 17
)
View Source
const (
	// DropdownBox arrow separation from border and items
	ARROW_PADDING int32 = 16
	// DropdownBox items separation
	DROPDOWN_ITEMS_SPACING = 17
)
View Source
const (
	// TextBox/TextBoxMulti/ValueBox/Spinner inner text padding
	TEXT_INNER_PADDING int32 = 16
	// TextBoxMulti lines separation
	TEXT_LINES_SPACING = 17
)
View Source
const (
	// Spinner left/right buttons width
	SPIN_BUTTON_WIDTH int32 = 16
	// Spinner buttons separation
	SPIN_BUTTON_SPACING = 17
)
View Source
const (
	// ListView items height
	LIST_ITEMS_HEIGHT int32 = 16
	// ListView items separation
	LIST_ITEMS_SPACING = 17
	// ListView scrollbar size (usually width)
	SCROLLBAR_WIDTH = 18
	// ListView scrollbar side (0-left, 1-right)
	SCROLLBAR_SIDE = 19
)
View Source
const (
	COLOR_SELECTOR_SIZE int32 = 16
	// colorex.RGBA right hue bar width
	HUEBAR_WIDTH = 17
	// colorex.RGBA right hue bar separation from panel
	HUEBAR_PADDING = 18
	// colorex.RGBA right hue bar selector height
	HUEBAR_SELECTOR_HEIGHT = 19
	// colorex.RGBA right hue bar selector overflow
	HUEBAR_SELECTOR_OVERFLOW = 20
)
View Source
const (
	ICON_NONE int32 = iota
	ICON_FOLDER_FILE_OPEN
	ICON_FILE_SAVE_CLASSIC
	ICON_FOLDER_OPEN
	ICON_FOLDER_SAVE
	ICON_FILE_OPEN
	ICON_FILE_SAVE
	ICON_FILE_EXPORT
	ICON_FILE_ADD
	ICON_FILE_DELETE
	ICON_FILETYPE_TEXT
	ICON_FILETYPE_AUDIO
	ICON_FILETYPE_IMAGE
	ICON_FILETYPE_PLAY
	ICON_FILETYPE_VIDEO
	ICON_FILETYPE_INFO
	ICON_FILE_COPY
	ICON_FILE_CUT
	ICON_FILE_PASTE
	ICON_CURSOR_HAND
	ICON_CURSOR_POINTER
	ICON_CURSOR_CLASSIC
	ICON_PENCIL
	ICON_PENCIL_BIG
	ICON_BRUSH_CLASSIC
	ICON_BRUSH_PAINTER
	ICON_WATER_DROP
	ICON_COLOR_PICKER
	ICON_RUBBER
	ICON_COLOR_BUCKET
	ICON_TEXT_T
	ICON_TEXT_A
	ICON_SCALE
	ICON_RESIZE
	ICON_FILTER_POINT
	ICON_FILTER_BILINEAR
	ICON_CROP
	ICON_CROP_ALPHA
	ICON_SQUARE_TOGGLE
	ICON_SYMMETRY
	ICON_SYMMETRY_HORIZONTAL
	ICON_SYMMETRY_VERTICAL
	ICON_LENS
	ICON_LENS_BIG
	ICON_EYE_ON
	ICON_EYE_OFF
	ICON_FILTER_TOP
	ICON_FILTER
	ICON_TARGET_POINT
	ICON_TARGET_SMALL
	ICON_TARGET_BIG
	ICON_TARGET_MOVE
	ICON_CURSOR_MOVE
	ICON_CURSOR_SCALE
	ICON_CURSOR_SCALE_RIGHT
	ICON_CURSOR_SCALE_LEFT
	ICON_UNDO
	ICON_REDO
	ICON_REREDO
	ICON_MUTATE
	ICON_ROTATE
	ICON_REPEAT
	ICON_SHUFFLE
	ICON_EMPTYBOX
	ICON_TARGET
	ICON_TARGET_SMALL_FILL
	ICON_TARGET_BIG_FILL
	ICON_TARGET_MOVE_FILL
	ICON_CURSOR_MOVE_FILL
	ICON_CURSOR_SCALE_FILL
	ICON_CURSOR_SCALE_RIGHT_FILL
	ICON_CURSOR_SCALE_LEFT_FILL
	ICON_UNDO_FILL
	ICON_REDO_FILL
	ICON_REREDO_FILL
	ICON_MUTATE_FILL
	ICON_ROTATE_FILL
	ICON_REPEAT_FILL
	ICON_SHUFFLE_FILL
	ICON_EMPTYBOX_SMALL
	ICON_BOX
	ICON_BOX_TOP
	ICON_BOX_TOP_RIGHT
	ICON_BOX_RIGHT
	ICON_BOX_BOTTOM_RIGHT
	ICON_BOX_BOTTOM
	ICON_BOX_BOTTOM_LEFT
	ICON_BOX_LEFT
	ICON_BOX_TOP_LEFT
	ICON_BOX_CENTER
	ICON_BOX_CIRCLE_MASK
	ICON_POT
	ICON_ALPHA_MULTIPLY
	ICON_ALPHA_CLEAR
	ICON_DITHERING
	ICON_MIPMAPS
	ICON_BOX_GRID
	ICON_GRID
	ICON_BOX_CORNERS_SMALL
	ICON_BOX_CORNERS_BIG
	ICON_FOUR_BOXES
	ICON_GRID_FILL
	ICON_BOX_MULTISIZE
	ICON_ZOOM_SMALL
	ICON_ZOOM_MEDIUM
	ICON_ZOOM_BIG
	ICON_ZOOM_ALL
	ICON_ZOOM_CENTER
	ICON_BOX_DOTS_SMALL
	ICON_BOX_DOTS_BIG
	ICON_BOX_CONCENTRIC
	ICON_BOX_GRID_BIG
	ICON_OK_TICK
	ICON_CROSS
	ICON_ARROW_LEFT
	ICON_ARROW_RIGHT
	ICON_ARROW_DOWN
	ICON_ARROW_UP
	ICON_ARROW_LEFT_FILL
	ICON_ARROW_RIGHT_FILL
	ICON_ARROW_DOWN_FILL
	ICON_ARROW_UP_FILL
	ICON_AUDIO
	ICON_FX
	ICON_WAVE
	ICON_WAVE_SINUS
	ICON_WAVE_SQUARE
	ICON_WAVE_TRIANGULAR
	ICON_CROSS_SMALL
	ICON_PLAYER_PREVIOUS
	ICON_PLAYER_PLAY_BACK
	ICON_PLAYER_PLAY
	ICON_PLAYER_PAUSE
	ICON_PLAYER_STOP
	ICON_PLAYER_NEXT
	ICON_PLAYER_RECORD
	ICON_MAGNET
	ICON_LOCK_CLOSE
	ICON_LOCK_OPEN
	ICON_CLOCK
	ICON_TOOLS
	ICON_GEAR
	ICON_GEAR_BIG
	ICON_BIN
	ICON_HAND_POINTER
	ICON_LASER
	ICON_COIN
	ICON_EXPLOSION
	ICON_1UP
	ICON_PLAYER
	ICON_PLAYER_JUMP
	ICON_KEY
	ICON_DEMON
	ICON_TEXT_POPUP
	ICON_GEAR_EX
	ICON_CRACK
	ICON_CRACK_POINTS
	ICON_STAR
	ICON_DOOR
	ICON_EXIT
	ICON_MODE_2D
	ICON_MODE_3D
	ICON_CUBE
	ICON_CUBE_FACE_TOP
	ICON_CUBE_FACE_LEFT
	ICON_CUBE_FACE_FRONT
	ICON_CUBE_FACE_BOTTOM
	ICON_CUBE_FACE_RIGHT
	ICON_CUBE_FACE_BACK
	ICON_CAMERA
	ICON_SPECIAL
	ICON_LINK_NET
	ICON_LINK_BOXES
	ICON_LINK_MULTI
	ICON_LINK
	ICON_LINK_BROKE
	ICON_TEXT_NOTES
	ICON_NOTEBOOK
	ICON_SUITCASE
	ICON_SUITCASE_ZIP
	ICON_MAILBOX
	ICON_MONITOR
	ICON_PRINTER
	ICON_PHOTO_CAMERA
	ICON_PHOTO_CAMERA_FLASH
	ICON_HOUSE
	ICON_HEART
	ICON_CORNER
	ICON_VERTICAL_BARS
	ICON_VERTICAL_BARS_FILL
	ICON_LIFE_BARS
	ICON_INFO
	ICON_CROSSLINE
	ICON_HELP
	ICON_FILETYPE_ALPHA
	ICON_FILETYPE_HOME
	ICON_LAYERS_VISIBLE
	ICON_LAYERS
	ICON_WINDOW
	ICON_HIDPI
	ICON_FILETYPE_BINARY
	ICON_HEX
	ICON_SHIELD
	ICON_FILE_NEW
	ICON_FOLDER_ADD
	ICON_ALARM
	ICON_CPU
	ICON_ROM
	ICON_STEP_OVER
	ICON_STEP_INTO
	ICON_STEP_OUT
	ICON_RESTART
	ICON_BREAKPOINT_ON
	ICON_BREAKPOINT_OFF
	ICON_BURGER_MENU
	ICON_CASE_SENSITIVE
	ICON_REG_EXP
	ICON_FOLDER
	ICON_FILE
	ICON_SAND_TIMER
	ICON_220
	ICON_221
	ICON_222
	ICON_223
	ICON_224
	ICON_225
	ICON_226
	ICON_227
	ICON_228
	ICON_229
	ICON_230
	ICON_231
	ICON_232
	ICON_233
	ICON_234
	ICON_235
	ICON_236
	ICON_237
	ICON_238
	ICON_239
	ICON_240
	ICON_241
	ICON_242
	ICON_243
	ICON_244
	ICON_245
	ICON_246
	ICON_247
	ICON_248
	ICON_249
	ICON_250
	ICON_251
	ICON_252
	ICON_253
	ICON_254
	ICON_255
)

Icons enumeration

View Source
const (
	CHECK_PADDING int32 = 16
)
View Source
const (
	GROUP_PADDING int32 = 16
)

GROUP_PADDING .

View Source
const (
	// ProgressBar internal padding
	PROGRESS_PADDING int32 = 16
)

Variables

This section is empty.

Functions

func Button

func Button(bounds rect2.Float32, text string) bool

Button control, returns true when clicked

func CheckBox

func CheckBox(bounds rect2.Float32, text string, checked bool) bool

CheckBox control, returns true when active

func ColorBarAlpha

func ColorBarAlpha(bounds rect2.Float32, text string, alpha float32) float32

ColorBarAlpha control

func ColorBarHue

func ColorBarHue(bounds rect2.Float32, text string, value float32) float32

ColorBarHue control

func ColorPanel

func ColorPanel(bounds rect2.Float32, text string, color colorex.RGBA) colorex.RGBA

ColorPanel control

func ColorPanelHSV

func ColorPanelHSV(bounds rect2.Float32, text string, colorHSV *vector3.Float32) int32

ColorPanelHSV - Color Panel control that returns HSV color value, used by GuiColorPickerHSV()

func ColorPicker

func ColorPicker(bounds rect2.Float32, text string, color colorex.RGBA) colorex.RGBA

ColorPicker control (multiple color controls)

func ColorPickerHSV

func ColorPickerHSV(bounds rect2.Float32, text string, colorHSV *vector3.Float32) int32

ColorPickerHSV - Color Picker control that avoids conversion to RGB on each call (multiple color controls)

func ComboBox

func ComboBox(bounds rect2.Float32, text string, active int32) int32

ComboBox control, returns selected item index

func Disable

func Disable()

GuiDisable - Disable gui controls (global state)

func DropdownBox(bounds rect2.Float32, text string, active *int32, editMode bool) bool

DropdownBox control

func DummyRec

func DummyRec(bounds rect2.Float32, text string)

DummyRec control for placeholders

func Enable

func Enable()

GuiEnable - Enable gui controls (global state)

func Fade

func Fade(color colorex.RGBA, alpha float32)

GuiFade - Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f

func GetFont

func GetFont() rl.Font

GetFont - get custom font (global state)

func GetStyle

func GetStyle(control int32, property int32) int32

GuiGetStyle - Get one style property

func GetTextSize

func GetTextSize(text string) vector2.Float32

func Grid

func Grid(bounds rect2.Float32, text string, spacing float32, subdivs int32, mouseCell *vector2.Float32) int32

Grid control, returns mouse cell position

func GroupBox

func GroupBox(bounds rect2.Float32, text string)

GuiGroupBox - Group Box control with text name

func GroupBoxEx

func GroupBoxEx(bounds rect2.Float32, text string, fn BoundsFn)

func IconText

func IconText(iconId int32, text string) string

IconText gets text with icon id prepended (if supported)

func IsLocked

func IsLocked() bool

GuiIsLocked - Check if gui is locked (global state)

func Label

func Label(bounds rect2.Float32, text string)

Label control, shows text

func LabelButton

func LabelButton(bounds rect2.Float32, text string) bool

LabelButton control, show true when clicked

func Line

func Line(bounds rect2.Float32, text string)

GuiLine - Line separator control, could contain text

func ListView

func ListView(bounds rect2.Float32, text string, scrollIndex *int32, active int32) int32

ListView control, returns selected list item index

func ListViewEx

func ListViewEx(bounds rect2.Float32, text []string, focus, scrollIndex *int32, active int32) int32

ListViewEx control with extended parameters

func LoadStyle

func LoadStyle(fileName string)

LoadStyle file over global style variable (.rgs)

func LoadStyleDefault

func LoadStyleDefault()

LoadStyleDefault over global style

func LoadStyleFromMemory

func LoadStyleFromMemory(data []byte)

LoadStyleFromMemory - Load style from memory (binary only)

func Lock

func Lock()

GuiLock - Lock gui controls (global state)

func MessageBox

func MessageBox(bounds rect2.Float32, title string, message string, buttons string) int32

MessageBox control, displays a message

func Panel

func Panel(bounds rect2.Float32, text string)

Panel - Panel control, useful to group controls

func PanelEx

func PanelEx(bounds rect2.Float32, text string, fn BoundsFn)

func ProgressBar

func ProgressBar(bounds rect2.Float32, textLeft string, textRight string, value float32, minValue float32, maxValue float32) float32

ProgressBar control, shows current progress value

func ScrollBar

func ScrollBar(bounds rect2.Float32, value, minValue, maxValue int32) int32

ScrollBar control (used by GuiScrollPanel())

func ScrollPanel

func ScrollPanel(bounds rect2.Float32, text string, content rect2.Float32, scroll *vector2.Float32, view *rect2.Float32) int32

ScrollPanel control - Scroll Panel control

func SetAlpha

func SetAlpha(alpha float32)

SetAlpha - set alpha (global state)

func SetFont

func SetFont(font rl.Font)

SetFont - set custom font (global state)

func SetScale

func SetScale(alpha float32)

SetScale - set scale (global state)

func SetState

func SetState(state GuiState)

GuiSetState - Set gui state (global state)

func SetStyle

func SetStyle(control int32, property int32, value int32)

GuiSetStyle .

func Slider

func Slider(bounds rect2.Float32, textLeft string, textRight string, value float32, minValue float32, maxValue float32) float32

Slider control

func SliderBar

func SliderBar(bounds rect2.Float32, textLeft string, textRight string, value float32, minValue float32, maxValue float32) float32

SliderBar control, returns selected value

func Spinner

func Spinner(bounds rect2.Float32, text string, value *int32, minValue, maxValue int, editMode bool) int32

Spinner control, returns selected value

func Spread

func Spread[S ~[]E, E any](s S, a, b vector2.Float32, maxd, mind float32, justify Justyfy) iter.Seq2[vector2.Float32, E]

func StatusBar

func StatusBar(bounds rect2.Float32, text string)

StatusBar control, shows info text

func TabBar

func TabBar(bounds rect2.Float32, text []string, active *int32) int32

TabBar control

func TextBox

func TextBox(bounds rect2.Float32, text *string, textSize int, editMode bool) bool

TextBox control, updates input text

func TextInputBox

func TextInputBox(bounds rect2.Float32, title, message, buttons string, text *string, textMaxSize int32, secretViewActive *bool) int32

TextInputBox control, ask for text

func Toggle

func Toggle(bounds rect2.Float32, text string, active bool) bool

Toggle control, returns true when active

func ToggleGroup

func ToggleGroup(bounds rect2.Float32, text string, active int32) int32

ToggleGroup control, returns active toggle index

func ToggleSlider

func ToggleSlider(bounds rect2.Float32, text string, active int32) int32

ToggleSlider control, returns true when clicked

func Unlock

func Unlock()

GuiUnlock - Unlock gui controls (global state)

func ValueBox

func ValueBox(bounds rect2.Float32, text string, value *int32, minValue, maxValue int, editMode bool) bool

ValueBox control, updates input text with numbers

func WindowBox

func WindowBox(bounds rect2.Float32, title string) bool

GuiWindowBox - Window Box control, shows a window that can be closed

Types

type BoundsFn

type BoundsFn func(bounds rect2.Float32)

type CStringArray

type CStringArray struct {
	Pointer unsafe.Pointer
	Length  int
}

CStringArray represents an array of pointers to NULL terminated C strings, the array itself is terminated with a NULL

func NewCStringArray

func NewCStringArray() CStringArray

NewCStringArray returns an instance of CStringArray

func NewCStringArrayFromPointer

func NewCStringArrayFromPointer(p unsafe.Pointer) CStringArray

func NewCStringArrayFromSlice

func NewCStringArrayFromSlice(ss []string) CStringArray

NewCStringArrayFromSlice makes an instance of CStringArray then copy the input slice to it.

func (*CStringArray) Copy

func (arr *CStringArray) Copy(ss []string)

Copy converts Go slice of strings to C underlying struct of CStringArray

func (*CStringArray) Free

func (arr *CStringArray) Free()

Free frees C underlying struct of CStringArray MUST call this method after using CStringArray Exception: If you use NewCStringArrayFromPointer() to create CStringArray object and you use other way to free C underlying structure pointed by the pointer, then don't need to call Free()

func (*CStringArray) IsNil

func (arr *CStringArray) IsNil() bool

func (*CStringArray) ToSlice

func (arr *CStringArray) ToSlice() []string

ToSlice converts CStringArray to Go slice of strings

type CanvasLayoutPanel

type CanvasLayoutPanel struct {
	// contains filtered or unexported fields
}

func CanvasLayout

func CanvasLayout(bounds rect2.Float32) CanvasLayoutPanel

func (*CanvasLayoutPanel) Anchor

func (l *CanvasLayoutPanel) Anchor(xy vector2.Float32) vector2.Float32

func (*CanvasLayoutPanel) Layout

type ComboBoxState

type ComboBoxState[T any] struct {
	// contains filtered or unexported fields
}

func (*ComboBoxState[T]) ActiveItem

func (s *ComboBoxState[T]) ActiveItem() T

func (*ComboBoxState[T]) ComboBox

func (s *ComboBoxState[T]) ComboBox(bounds rect2.Float32)

func (*ComboBoxState[T]) Free

func (s *ComboBoxState[T]) Free()

func (*ComboBoxState[T]) IsActiveItem

func (s *ComboBoxState[T]) IsActiveItem() bool

func (*ComboBoxState[T]) SetActiveItemIndex

func (s *ComboBoxState[T]) SetActiveItemIndex(i int32)

func (*ComboBoxState[T]) SetItems

func (s *ComboBoxState[T]) SetItems(items []T, nameFn func(i T) string)
type DropdownBoxState[T any] struct {
	// contains filtered or unexported fields
}
func (s *DropdownBoxState[T]) ActiveItem() T
func (s *DropdownBoxState[T]) DropdownBox(bounds rect2.Float32) bool
func (s *DropdownBoxState[T]) Free()
func (s *DropdownBoxState[T]) IsActiveItem() bool
func (s *DropdownBoxState[T]) SetActiveItem(fn func(T) bool)
func (s *DropdownBoxState[T]) SetActiveItemIndex(i int32)
func (s *DropdownBoxState[T]) SetItems(items []T, nameFn func(i T) string)

type GuiCheckBoxProperty

type GuiCheckBoxProperty = int32

GuiCheckBoxProperty .

type GuiColorPickerProperty

type GuiColorPickerProperty = int32

GuiColorPickerProperty .

type GuiComboBoxProperty

type GuiComboBoxProperty = int32

GuiComboBoxProperty .

type GuiControl

type GuiControl = int32

GuiControl .

const (
	DEFAULT GuiControl = iota
	LABEL
	BUTTON
	TOGGLE
	SLIDER
	PROGRESSBAR
	CHECKBOX
	COMBOBOX
	DROPDOWNBOX
	TEXTBOX
	VALUEBOX
	SPINNER
	LISTVIEW
	COLORPICKER
	SCROLLBAR
	STATUSBAR
)

DEFAULT - Gui controls

type GuiControlProperty

type GuiControlProperty = int32

GuiControlProperty .

const (
	BORDER_COLOR_NORMAL GuiControlProperty = iota
	BASE_COLOR_NORMAL
	TEXT_COLOR_NORMAL
	BORDER_COLOR_FOCUSED
	BASE_COLOR_FOCUSED
	TEXT_COLOR_FOCUSED
	BORDER_COLOR_PRESSED
	BASE_COLOR_PRESSED
	TEXT_COLOR_PRESSED
	BORDER_COLOR_DISABLED
	BASE_COLOR_DISABLED
	TEXT_COLOR_DISABLED
	BORDER_WIDTH
	TEXT_PADDING
	TEXT_ALIGNMENT
)

Gui base properties for every control NOTE: RAYGUI_MAX_PROPS_BASE properties (by default 16 properties)

type GuiDefaultProperty

type GuiDefaultProperty = int32

GuiDefaultProperty .

const (
	TEXT_SIZE GuiDefaultProperty = iota + 16
	TEXT_SPACING
	LINE_COLOR
	BACKGROUND_COLOR
	TEXT_LINE_SPACING
	TEXT_ALIGNMENT_VERTICAL
	TEXT_WRAP_MODE
)

DEFAULT extended properties NOTE: Those properties are common to all controls or global

type GuiDropdownBoxProperty

type GuiDropdownBoxProperty = int32

GuiDropdownBoxProperty .

type GuiListViewProperty

type GuiListViewProperty = int32

GuiListViewProperty .

type GuiProgressBarProperty

type GuiProgressBarProperty = int32

GuiProgressBarProperty .

type GuiScrollBarProperty

type GuiScrollBarProperty = int32

GuiScrollBarProperty .

type GuiSliderProperty

type GuiSliderProperty = int32

GuiSliderProperty .

type GuiSpinnerProperty

type GuiSpinnerProperty = int32

GuiSpinnerProperty .

type GuiState

type GuiState int32

GuiState .

const (
	STATE_NORMAL GuiState = iota
	STATE_FOCUSED
	STATE_PRESSED
	STATE_DISABLED
)

func GetState

func GetState() GuiState

GuiGetState - Get gui state (global state)

type GuiStyleProp

type GuiStyleProp struct {
	// contains filtered or unexported fields
}

GuiStyleProp - Style property

type GuiTextAlignment

type GuiTextAlignment = int32

GuiTextAlignment .

const (
	TEXT_ALIGN_LEFT GuiTextAlignment = iota
	TEXT_ALIGN_CENTER
	TEXT_ALIGN_RIGHT
)

Gui control text alignment

type GuiTextAlignmentVertical

type GuiTextAlignmentVertical = int32

GuiTextAlignmentVertical .

const (
	TEXT_ALIGN_TOP GuiTextAlignmentVertical = iota
	TEXT_ALIGN_MIDDLE
	TEXT_ALIGN_BOTTOM
)

Gui control text alignment vertical

type GuiTextBoxProperty

type GuiTextBoxProperty = int32

GuiTextBoxProperty .

type GuiTextWrapMode

type GuiTextWrapMode = int32

GuiTextWrapMode .

const (
	TEXT_WRAP_NONE GuiTextWrapMode = iota
	TEXT_WRAP_CHAR
	TEXT_WRAP_WORD
)

Gui control text wrap mode NOTE: Useful for multiline text

type GuiToggleProperty

type GuiToggleProperty = int32

GuiToggleProperty .

type HorizontalLayoutPanel

type HorizontalLayoutPanel struct {
	// contains filtered or unexported fields
}

func HorizontalLayout

func HorizontalLayout(bounds rect2.Float32, spacing int) HorizontalLayoutPanel

func (*HorizontalLayoutPanel) Anchor

func (l *HorizontalLayoutPanel) Anchor(xy vector2.Float32) vector2.Float32

func (*HorizontalLayoutPanel) Fill

func (hl *HorizontalLayoutPanel) Fill(height float32, justify Justyfy) rect2.Float32

func (*HorizontalLayoutPanel) Layout

func (hl *HorizontalLayoutPanel) Layout(wh vector2.Float32, justify Justyfy) rect2.Float32

func (*HorizontalLayoutPanel) Pie

func (hl *HorizontalLayoutPanel) Pie(percent float32) rect2.Float32

type Justyfy

type Justyfy int
const (
	JustifyTop Justyfy = iota
	JustifyCenter
	JustifyBottom
	JustifyFill
	JustifyLeft
	JustifyRight
)

func (Justyfy) Justyfy

func (j Justyfy) Justyfy(v, max float32) (nv, dv float32)

Justify a segment of width v in a segment of width max returns new segmend width amd distance from start

/--------max-------------/
/-----v----/
JustifyTop, JustifyLeft:
/-----v----/                 (v, 0)
JustifyCenter:
        /-----v----/         (v, (max - v) / 2)
JustifyBottom, JustifyRight:
              /-----v----/   (v, max - v)
JustifyFill:
/---------v--------------/   (max, 0)

type ListViewState

type ListViewState[T any] struct {
	// contains filtered or unexported fields
}

func (*ListViewState[T]) ActiveItem

func (s *ListViewState[T]) ActiveItem() T

func (*ListViewState[T]) Free

func (s *ListViewState[T]) Free()

func (*ListViewState[T]) IsActiveItem

func (s *ListViewState[T]) IsActiveItem() bool

func (*ListViewState[T]) ListView

func (s *ListViewState[T]) ListView(bounds rect2.Float32)

func (*ListViewState[T]) SetItems

func (s *ListViewState[T]) SetItems(items []T, nameFn func(i T) string)

type VerticalLayoutPanel

type VerticalLayoutPanel struct {
	// contains filtered or unexported fields
}

func VerticalLayout

func VerticalLayout(bounds rect2.Float32, spacing int) VerticalLayoutPanel

func (*VerticalLayoutPanel) Anchor

func (l *VerticalLayoutPanel) Anchor(xy vector2.Float32) vector2.Float32

func (*VerticalLayoutPanel) Fill

func (vl *VerticalLayoutPanel) Fill(width float32, justify Justyfy) rect2.Float32

func (*VerticalLayoutPanel) Layout

func (vl *VerticalLayoutPanel) Layout(wh vector2.Float32, justify Justyfy) rect2.Float32

func (*VerticalLayoutPanel) Pie

func (vl *VerticalLayoutPanel) Pie(percent float32) rect2.Float32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL