Documentation ¶
Index ¶
- Constants
- func Color(r, g, b uint8) imgui.Vec4
- func ColorA(r, g, b, a uint8) imgui.Vec4
- func IV(x, y float64) imgui.Vec2
- func IVec(v pixel.Vec) imgui.Vec2
- func IZV() imgui.Vec2
- func PV(v imgui.Vec2) pixel.Vec
- func ProjectV(x, y float64) imgui.Vec2
- func ProjectVec(v pixel.Vec) imgui.Vec2
- func Sprite(sprite *pixel.Sprite) imgui.TextureID
- func UnprojectV(v imgui.Vec2) pixel.Vec
- type Clipboard
- type UI
- func (ui *UI) AddSprite(name string, sprite *pixel.Sprite) imgui.TextureID
- func (ui *UI) AddSpriteFromFile(path string) (id imgui.TextureID, sprite *pixel.Sprite)
- func (ui *UI) AddSpriteFromFileV(name, path string) (id imgui.TextureID, sprite *pixel.Sprite)
- func (ui *UI) AddTTFFont(path string, size float32)
- func (ui *UI) Destroy()
- func (ui *UI) Draw(win *pixelgl.Window)
- func (ui UI) GetPacker() *packer.AliasPacker
- func (ui *UI) Image(alias interface{}, scale float64)
- func (ui *UI) ImageButton(alias interface{}, scale float64) bool
- func (ui *UI) JustPressed(button pixelgl.Button) bool
- func (ui *UI) JustReleased(button pixelgl.Button) bool
- func (ui *UI) KeyAlt() bool
- func (ui *UI) KeyCtrl() bool
- func (ui *UI) KeyShift() bool
- func (ui *UI) KeySuper() bool
- func (ui *UI) MouseScroll() pixel.Vec
- func (ui *UI) NewFrame()
- func (ui *UI) Pressed(button pixelgl.Button) bool
- func (ui *UI) Repeated(button pixelgl.Button) bool
Constants ¶
const ( WrappedNone = iota WrappedSprite WrappedBatch WrappedCanvas )
const (
NO_DEFAULT_FONT uint8 = 1 << iota
)
pixelui.NewUI flags:
NO_DEFAULT_FONT: Do not load the default font during NewUI.
Variables ¶
This section is empty.
Functions ¶
func Color ¶
func Color(r, g, b uint8) imgui.Vec4
Color converts the given 8-bit r,g,b components to a imgui.Vec4 for color arguments
func ColorA ¶
func ColorA(r, g, b, a uint8) imgui.Vec4
Color converts the given 8-bit r,g,b,a components to a imgui.Vec4 for color arguments
func ProjectV ¶
func ProjectV(x, y float64) imgui.Vec2
ProjectV creates a pixel vector and projects it using ProjectVec
func ProjectVec ¶
ProjectVec projects the vector by the UI's matrix (vertical flip)
and returns that as a imgui vector
func UnprojectV ¶
UnprojectV unprojects the vector by the UI's matrix (vertical flip)
and returns that as a pixel vector
Types ¶
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI Stores the state of the pixelui UI
var CurrentUI *UI
func (*UI) AddSpriteFromFile ¶
func (*UI) AddSpriteFromFileV ¶
func (*UI) AddTTFFont ¶
AddTTFFont loads the given font into imgui.
func (UI) GetPacker ¶
func (ui UI) GetPacker() *packer.AliasPacker
func (*UI) Image ¶
Image is a helper for imgui.Image that looks up the sprite in the internal packed atlas.
func (*UI) ImageButton ¶
ImageButton is a helper for imgui.ImageButton that looks up the sprite in the internal packed atlas.
func (*UI) JustPressed ¶
JustPressed returns true if imgui hasn't handled the button and the button was just pressed
func (*UI) JustReleased ¶
JustPressed returns true if imgui hasn't handled the button and the button was just released
func (*UI) MouseScroll ¶
MouseScroll returns the mouse scroll amount if imgui does not want the mouse
(if mouse is not hovering an imgui element)
func (*UI) NewFrame ¶
func (ui *UI) NewFrame()
NewFrame Call this at the beginning of the frame to tell the UI that the frame has started