gui

package
v0.0.0-...-00121b1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GUI

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

GUI is used for rendering a graphical user interface using the underlying rendering api used by simgl

func Make

func Make(window *glfw.Window) GUI

Make creates a new GUI. It attaches itself to the specified window.

func New

func New(window *glfw.Window) *GUI

New returns a pointer to the newly created GUI object. The GUI attaches itself to the specified window.

func (*GUI) Begin

func (gui *GUI) Begin()

Begin marks the new frame of rendering the GUI. Make sure that the gui has at least one menu item else it will crash the program.

func (*GUI) BeginGroup

func (gui *GUI) BeginGroup(name string, height float32) bool

BeginGroup starts a new group

func (*GUI) BeginWindow

func (gui *GUI) BeginWindow(name string, x, y, width, height float32) bool

BeginWindow starts a new menu window.

func (*GUI) Button

func (gui *GUI) Button(name string, isPressed *bool)

Button draws a button of the specified name and pressed state.

func (*GUI) Checkbox

func (gui *GUI) Checkbox(name string, ischecked *bool)

Checkbox draw a checkbox with the specified label and checked state.

func (*GUI) ColorPicker

func (gui *GUI) ColorPicker(name string, rgba *mgl32.Vec4)

ColorPicker provides a color picker widget that returns the components of the selected RGBa color.

func (*GUI) End

func (gui *GUI) End()

End renders all specified GUI objects that had been specified.

func (*GUI) EndGroup

func (gui *GUI) EndGroup()

EndGroup ends the current group

func (*GUI) EndWindow

func (gui *GUI) EndWindow()

EndWindow ends a new menu window.

func (*GUI) Input3

func (gui *GUI) Input3(name string, vec *mgl32.Vec3, min, max, step float32)

Input3 draws three value inputs for representing a vector 3D.

func (*GUI) Label

func (gui *GUI) Label(name string)

Label draws a label with the specified text.

func (*GUI) OnCursorPosMove

func (gui *GUI) OnCursorPosMove(x, y, dx, dy float64) bool

OnCursorPosMove is a callback function for a cursor move event.

func (*GUI) OnKeyPress

func (gui *GUI) OnKeyPress(key, action, mods int) bool

OnKeyPress is a callback function for a key press event.

func (*GUI) OnMouseButtonPress

func (gui *GUI) OnMouseButtonPress(leftPressed, rightPressed bool) bool

OnMouseButtonPress is a callback function for a mouse button press event.

func (*GUI) OnMouseScroll

func (gui *GUI) OnMouseScroll(x, y float64) bool

OnMouseScroll is a callback function for a mouse scroll event.

func (*GUI) OnResize

func (gui *GUI) OnResize(width, height int) bool

OnResize is a callback function for a window resize event.

func (*GUI) Selector

func (gui *GUI) Selector(name string, items []string, selectedIdx *int32) bool

Selector draws a combo box with the specified items and returns the selected item index.

func (*GUI) Slider3

func (gui *GUI) Slider3(name string, vec *mgl32.Vec3, min, max, step float32)

Slider3 draws a slider with the specified bounds, a value step size for the resulution of the slider values and returns the current value.

func (*GUI) SliderFloat32

func (gui *GUI) SliderFloat32(name string, value *float32, min, max, step float32)

SliderFloat32 draws a slider with the specified bounds, a value step size for the resulution of the slider values and returns the current value.

func (*GUI) SliderInt32

func (gui *GUI) SliderInt32(name string, value *int32, min, max, step int32)

SliderInt32 draws a slider with the specified bounds, a value step size for the resulution of the slider values and returns the current value.

Jump to

Keyboard shortcuts

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