sui

package module
v0.0.0-...-2a0f07a Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OnLoop func()
View Source
var Palette = palette{

	Passive: Color32b(0x455a64ff),
	Active:  Color32b(0x593e37ff),
	Accent:  Color32b(0x0277bdff),
	Select:  Color32b(0x01579bff),

	Normal:  Color32b(0x000000ff),
	Info:    Color32b(0xcfd8dcff),
	Warning: Color32b(0xff9800ff),
	Error:   Color32b(0xff5722ff),
	// contains filtered or unexported fields
}

Functions

func Close

func Close()

Close ...

func DropFile

func DropFile() string

func Init

func Init() error

Init ...

func InitFonts

func InitFonts()

InitFonts ...

func KeySym

func KeySym() int

func MaxInt

func MaxInt(a, b int) int

func MinInt

func MinInt(a, b int) int

func ModShift

func ModShift() int

func MouseButton

func MouseButton() int

func PostUpdate

func PostUpdate()

func Run

func Run() int

Run ...

func SetSender

func SetSender(o Widget)

Types

type Box

type Box struct {
	Widget

	OnDraw            func()
	OnEnter           func()
	OnLeave           func()
	OnMouseButtonDown func()
	OnMouseButtonUp   func()
	OnMouseClick      func()
	OnMouseOver       func()
	OnMouseScroll     func()
	OnKeyPress        func()
	OnResize          func()
	// contains filtered or unexported fields
}

func NewBox

func NewBox(w, h int) *Box

func (*Box) AddChild

func (o *Box) AddChild(child Widget)

func (*Box) Children

func (o *Box) Children() []Widget

func (*Box) Clear

func (o *Box) Clear()

func (*Box) ClearColor

func (o *Box) ClearColor() Color

func (*Box) Close

func (o *Box) Close()

func (*Box) Color

func (o *Box) Color() Color

func (*Box) Draw

func (o *Box) Draw()

func (*Box) Fill

func (o *Box) Fill(rect Rect)

func (*Box) Font

func (o *Box) Font() *ttf.Font

func (*Box) Line

func (o *Box) Line(a, b Point)

func (*Box) Move

func (o *Box) Move(x, y int)

func (*Box) Parent

func (o *Box) Parent() Widget

func (*Box) Pos

func (o *Box) Pos() Point

func (*Box) Rect

func (o *Box) Rect(rect Rect)

func (*Box) RemoveChild

func (o *Box) RemoveChild(child Widget)

func (*Box) Renderer

func (o *Box) Renderer() *sdl.Renderer

func (*Box) Repaint

func (o *Box) Repaint()

func (*Box) Resize

func (o *Box) Resize(w, h int)

func (*Box) SetClearColor

func (o *Box) SetClearColor(color Color)

func (*Box) SetColor

func (o *Box) SetColor(color Color)

func (*Box) SetFont

func (o *Box) SetFont(font *ttf.Font)

func (*Box) SetParent

func (o *Box) SetParent(parent Widget)

func (*Box) SetPos

func (o *Box) SetPos(pos Point)

func (*Box) SetSize

func (o *Box) SetSize(size Point)

func (*Box) SetTextColor

func (o *Box) SetTextColor(color Color)

func (*Box) Size

func (o *Box) Size() Point

func (*Box) Surface

func (o *Box) Surface() *sdl.Surface

func (*Box) TextColor

func (o *Box) TextColor() Color

func (*Box) TranslateAbsToRel

func (o *Box) TranslateAbsToRel(x, y int) (int, int)

func (*Box) WriteText

func (o *Box) WriteText(pos Point, str string) Point

type Color

type Color struct {
	sdl.Color
	// contains filtered or unexported fields
}

func Color32

func Color32(c int64) Color

func Color32b

func Color32b(c int64) Color

func (Color) Hi

func (o Color) Hi() Color

func (Color) Lo

func (o Color) Lo() Color

func (Color) RGBA

func (o Color) RGBA() (byte, byte, byte, byte)

type Point

type Point struct {
	X, Y int
}

func MousePos

func MousePos() Point

func MouseScroll

func MouseScroll() Point

func NewPoint

func NewPoint(x, y int) Point

func (*Point) Max

func (o *Point) Max(point Point)

func (*Point) Min

func (o *Point) Min(point Point)

type Rect

type Rect struct {
	Pos  Point
	Size Point
}

func NewRect

func NewRect(pos, size Point) Rect

func (*Rect) Extend

func (o *Rect) Extend(d int)

func (Rect) Rect

func (o Rect) Rect() *sdl.Rect

func (Rect) XYWH

func (o Rect) XYWH() (int32, int32, int32, int32)

type RootWindow

type RootWindow struct {
	Box

	OnDropFile func()
	// contains filtered or unexported fields
}

RootWindow ...

func NewRootWindow

func NewRootWindow(title string, width, height int) *RootWindow

NewRootWindow ...

func (*RootWindow) Close

func (o *RootWindow) Close()

func (*RootWindow) Resize

func (o *RootWindow) Resize(w, h int)

func (*RootWindow) SetSize

func (o *RootWindow) SetSize(_ Point)

func (*RootWindow) UpdateSurface

func (o *RootWindow) UpdateSurface()

type Widget

type Widget interface {
	Close()
	Parent() Widget
	SetParent(Widget)
	Children() []Widget
	AddChild(child Widget)
	RemoveChild(child Widget)
	Pos() Point
	SetPos(pos Point)
	Move(x, y int)
	Size() Point
	SetSize(size Point)
	Resize(width, height int)
	Font() *ttf.Font
	Surface() *sdl.Surface
	Renderer() *sdl.Renderer
	Repaint()
	SetClearColor(color Color)
	SetColor(color Color)
	SetTextColor(color Color)
	ClearColor() Color
	Color() Color
	TextColor() Color
	Clear()
	Fill(rect Rect)
	Rect(rect Rect)
	Line(a, b Point)
	WriteText(pos Point, str string) Point
	//IsInside(x, y int32) bool
	TranslateAbsToRel(x, y int) (int, int)
	Draw()
	// contains filtered or unexported methods
}

func MouseOver

func MouseOver() Widget

func PrevMouseOver

func PrevMouseOver() Widget

func Sender

func Sender() Widget

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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