Documentation ¶
Index ¶
- func Button(id gui.ID, text string, style *gui.ButtonStyle, p *Options) (event gui.EventType)
- func CheckBox(text string, style *gui.CheckBoxStyle) bool
- func Clear(names ...string)
- func Define(name string)
- func DefineType(name string, xt ViewType)
- func Image(id gui.ID, tex gfx.Tex2D, style *gui.ImageStyle, p *Options)
- func ImageButton(id gui.ID, normal, pressed gfx.Tex2D, style *gui.ImageButtonStyle, p *Options) gui.EventType
- func InputText(hint string, style *gui.InputStyle, p *Options)
- func Layout(id gui.ID, gui func(g *Group), w, h float32, xt LayoutType)
- func LayoutX(id gui.ID, gui func(g *Group), opt *Options, xt LayoutType)
- func ListView()
- func ProgressBar(fraction float32, style *gui.ProgressBarStyle, p *Options)
- func Slider(id gui.ID, value *float32, style *gui.SliderStyle, p *Options) (v gui.EventType)
- func Text(id gui.ID, text string, style *gui.TextStyle, p *Options)
- func TextSizeColored(id gui.ID, text string, color gfx.Color, size float32, opt *Options)
- type DirtyFlag
- type Element
- type Flag
- type Group
- type LayoutMan
- func (lm *LayoutMan) BeginElement(id g.ID, opt *Options) (elem *Element, ok bool)
- func (lm *LayoutMan) BeginLayout(id g.ID, opt *Options, xtype LayoutType)
- func (lm *LayoutMan) Button(id g.ID, text string, style *g.ButtonStyle, opt *Options) (event g.EventType)
- func (lm *LayoutMan) Clear(names ...string)
- func (lm *LayoutMan) DefineLayout(name string, xt ViewType)
- func (lm *LayoutMan) EndElement(elem *Element)
- func (lm *LayoutMan) EndLayout()
- func (lm *LayoutMan) Image(id g.ID, tex gfx.Tex2D, style *g.ImageStyle, opt *Options)
- func (lm *LayoutMan) ImageButton(id g.ID, normal, pressed gfx.Tex2D, style *g.ImageButtonStyle, opt *Options) (event g.EventType)
- func (lm *LayoutMan) InputText(hint string, lyt layout, style *g.InputStyle)
- func (lm *LayoutMan) Slider(id g.ID, value *float32, style *g.SliderStyle, opt *Options) (e g.EventType)
- func (lm *LayoutMan) Text(id g.ID, text string, style *g.TextStyle, opt *Options) *Element
- type LayoutType
- type Options
- type ViewType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefineType ¶
func ImageButton ¶
func InputText ¶
func InputText(hint string, style *gui.InputStyle, p *Options)
Widgets: InputEditor
func ProgressBar ¶
func ProgressBar(fraction float32, style *gui.ProgressBarStyle, p *Options)
Widget: ProgressBar, Slider
Types ¶
type Group ¶
type Group struct { LayoutType Flag *Element // 仅用来缓存... Cursor struct{ X, Y float32 } Offset struct{ X, Y float32 } gui.Padding // 当前帧布局的计算变量 Size struct{ W, H float32 } Gravity struct{ X, Y float32 } // contains filtered or unexported fields }
func (*Group) SetGravity ¶
func (*Group) SetPadding ¶
type LayoutMan ¶
func (*LayoutMan) BeginElement ¶
计算单个UI元素 如果有大小则记录出偏移和Margin 否则只返回元素
func (*LayoutMan) BeginLayout ¶
func (lm *LayoutMan) BeginLayout(id g.ID, opt *Options, xtype LayoutType)
func (*LayoutMan) Button ¶
func (lm *LayoutMan) Button(id g.ID, text string, style *g.ButtonStyle, opt *Options) (event g.EventType)
Widget: Button
func (*LayoutMan) DefineLayout ¶
func (*LayoutMan) EndElement ¶
结束绘制, 每绘制完一个元素都要偏移一下光标
func (*LayoutMan) ImageButton ¶
func (*LayoutMan) InputText ¶
func (lm *LayoutMan) InputText(hint string, lyt layout, style *g.InputStyle)
Widgets: InputEditor
type LayoutType ¶
type LayoutType int
Awesome GUI System
const ( Vertical LayoutType = iota Horizontal OverLay )
Click to show internal directories.
Click to hide internal directories.