egui

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: Apache-2.0 Imports: 19 Imported by: 1

README

egui

Ebiten Graphical User Interface (and Framework)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSliceNameInvalid is returned when a slice name has invalid characters or too short
	ErrSliceNameInvalid = fmt.Errorf("slice name invalid")
	// ErrSliceAlreadyExists is returned when a slice already exists
	ErrSliceAlreadyExists = fmt.Errorf("slice already exists")
	// ErrSliceNotFound is returned when a slice is not loaded into the UI
	ErrSliceNotFound = fmt.Errorf("slice not found")
)
View Source
var (
	// ErrElementNameInvalid is returned when a element name has invalid characters or too short
	ErrElementNameInvalid = fmt.Errorf("element name invalid")
	// ErrElementAlreadyExists is returned when a element already exists
	ErrElementAlreadyExists = fmt.Errorf("element already exists")
	// ErrElementNotFound is returned when a element is not loaded into the UI
	ErrElementNotFound = fmt.Errorf("element not found")
	// ErrFontNameInvalid is returned when a font name has invalid characters or too short
	ErrFontNameInvalid = fmt.Errorf("font name invalid")
	// ErrFontAlreadyExists is returned when a font already exists
	ErrFontAlreadyExists = fmt.Errorf("font already exists")
	// ErrFontNotFound is returned when a font was not found
	ErrFontNotFound = fmt.Errorf("font not found")
	// ErrFontCannotRemoveDefault is returned when you attempt to delete a font currently set as default
	ErrFontCannotRemoveDefault = fmt.Errorf("font is default, cannot remove")
	// ErrImageNameInvalid is returned when a image name has invalid characters or too short
	ErrImageNameInvalid = fmt.Errorf("image name invalid")
	// ErrImageAlreadyExists is returned when a image already exists
	ErrImageAlreadyExists = fmt.Errorf("image already exists")
	// ErrImageNotFound is returned when a image was not found
	ErrImageNotFound = fmt.Errorf("image not found")
	// ErrSceneNameInvalid is returned when a scene name has invalid characters or too short
	ErrSceneNameInvalid = fmt.Errorf("scene name invalid")
	// ErrSceneAlreadyExists is returned when a Scene already exists
	ErrSceneAlreadyExists = fmt.Errorf("scene already exists")
	// ErrSceneNotFound is returned when a scene is not loaded into the UI
	ErrSceneNotFound = fmt.Errorf("scene not found")
)

Functions

func DrawNineSlicing added in v0.0.4

func DrawNineSlicing(dst, src *ebiten.Image, sliceKey *SliceKey, width int, height int, geoM *ebiten.GeoM, colorM *ebiten.ColorM)

DrawNineSlicing will render slicing data

func Index added in v0.0.8

func Index(gid uint32) uint32

Index strips a gid of rotation data

Types

type Animation added in v0.0.6

type Animation struct {
	//Counter tracks what animation frame is currently being played
	Counter int
	//Current sprite name being played
	CurrentName string
	//Speed to play animation
	Speed int
	//If the sheet has multiple sprites, which index of the bundle to use
	BundleIndex int
	CellWidth   float64
	CellHeight  float64
	Image       string
	Alpha       string
	Clips       [][]int
	BundleCount int
	Animations  map[string][][]float64
}

Animation handles animation details

type Button

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

Button represents a UI Button element

func (*Button) IsDestroyed

func (e *Button) IsDestroyed() bool

IsDestroyed returns true when the element is flagged for deletion

func (*Button) IsEnabled added in v0.0.4

func (e *Button) IsEnabled() bool

IsEnabled returns true if a button is enabled

func (*Button) IsVisible

func (e *Button) IsVisible() bool

IsVisible returns true if mob is visible

func (*Button) LerpPosition

func (e *Button) LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, endFunc func())

LerpPosition changes an element's position over duration

func (*Button) Name added in v0.0.4

func (e *Button) Name() string

Name returns a mob's name

func (*Button) RenderIndex added in v0.0.4

func (e *Button) RenderIndex() int64

RenderIndex returns the render index of element

func (*Button) SetEnabled added in v0.0.4

func (e *Button) SetEnabled(isEnabled bool)

SetEnabled changes if a button is enabled

func (*Button) SetIsDestroyed added in v0.0.4

func (e *Button) SetIsDestroyed(isDestroyed bool)

SetIsDestroyed sets an element to be destroyed on next update

func (*Button) SetOnPressFunction

func (e *Button) SetOnPressFunction(f func())

SetOnPressFunction lets you pass a function without the need of button handling

func (*Button) SetOnPressed

func (e *Button) SetOnPressed(f func(e *Button))

SetOnPressed sets a button state

func (*Button) SetRenderIndex added in v0.0.4

func (e *Button) SetRenderIndex(renderIndex int64)

SetRenderIndex sets the render index of element

func (*Button) SetShape

func (e *Button) SetShape(shape common.Rectangle)

SetShape sets an element's X/Y position as well as width/height

func (*Button) SetText added in v0.0.4

func (e *Button) SetText(text string)

SetText changes the text on the button

func (*Button) SetVisible added in v0.0.4

func (e *Button) SetVisible(isVisible bool)

SetVisible changes the visibility of a button

func (*Button) Shape

func (e *Button) Shape() *common.Rectangle

Shape returns an element's X/Y position as well as width/height

func (*Button) X added in v0.0.4

func (e *Button) X() float64

X returns the X position of a button

func (*Button) Y added in v0.0.4

func (e *Button) Y() float64

Y returns the Y position of a button

type Font added in v0.0.4

type Font struct {
	Face     font.Face
	Height   int
	Name     string
	Language language.Tag
	// contains filtered or unexported fields
}

Font contains related data for loading a font file

func (*Font) DrawText added in v0.0.4

func (f *Font) DrawText(dst *ebiten.Image, str string, ox, oy float64, scale float64, textAlign int, color color.Color, displayTextRuneCount int)

DrawText draws a text

type Frame

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

Frame represents a UI Frame element

func (*Frame) IsDestroyed

func (e *Frame) IsDestroyed() bool

IsDestroyed returns true when the element is flagged for deletion

func (*Frame) IsEnabled added in v0.0.4

func (e *Frame) IsEnabled() bool

IsEnabled returns true if a Frame is enabled

func (*Frame) IsVisible

func (e *Frame) IsVisible() bool

IsVisible returns true if mob is visible

func (*Frame) LerpPosition

func (e *Frame) LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, endFunc func())

LerpPosition changes an element's position over duration

func (*Frame) Name added in v0.0.4

func (e *Frame) Name() string

Name returns a mob's name

func (*Frame) RenderIndex added in v0.0.4

func (e *Frame) RenderIndex() int64

RenderIndex returns the render index of element

func (*Frame) SetIsDestroyed added in v0.0.4

func (e *Frame) SetIsDestroyed(isDestroyed bool)

SetIsDestroyed sets an element to be destroyed on next update

func (*Frame) SetIsEnabled added in v0.0.4

func (e *Frame) SetIsEnabled(isEnabled bool)

SetIsEnabled changes if a Frame is enabled

func (*Frame) SetOnPressFunction

func (e *Frame) SetOnPressFunction(f func())

SetOnPressFunction lets you pass a function without the need of Frame handling

func (*Frame) SetOnPressed

func (e *Frame) SetOnPressed(f func(e *Frame))

SetOnPressed sets a Frame state

func (*Frame) SetRenderIndex added in v0.0.4

func (e *Frame) SetRenderIndex(renderIndex int64)

SetRenderIndex sets the render index of element

func (*Frame) SetShape

func (e *Frame) SetShape(shape common.Rectangle)

SetShape sets an element's X/Y position as well as width/height

func (*Frame) SetText added in v0.0.4

func (e *Frame) SetText(text string)

SetText changes the text on the Frame

func (*Frame) Shape

func (e *Frame) Shape() *common.Rectangle

Shape returns an element's X/Y position as well as width/height

type GID added in v0.0.8

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

GID represents a global ID, uses rotation padding on the last 3 bytes

func NewGID added in v0.0.8

func NewGID(gid uint32) (g GID)

NewGID returns a GID

func (GID) D added in v0.0.8

func (g GID) D() bool

D returns true if diagonal flagged

func (GID) H added in v0.0.8

func (g GID) H() bool

H reads if the tile should be changed horizontal

func (GID) Index added in v0.0.8

func (g GID) Index() uint32

Index returns an index without flipping data

func (GID) Rotation added in v0.0.8

func (g GID) Rotation() (rotation int)

Rotation returns the rotation of the object. Can only be 0, 90, 180, or 270

func (GID) SetD added in v0.0.8

func (g GID) SetD(val bool)

SetD changes the horizontal flag

func (GID) SetH added in v0.0.8

func (g GID) SetH(val bool)

SetH changes the horizontal flag

func (GID) SetRotation added in v0.0.8

func (g GID) SetRotation(rotation int) (err error)

SetRotation sets the rotation of a tile clockwise, supports 0, 90, 180, 270

func (GID) SetV added in v0.0.8

func (g GID) SetV(val bool)

SetV changes the horizontal flag

func (GID) SetValue added in v0.0.8

func (g GID) SetValue() uint32

SetValue sets the true GID value packed with rotation data

func (GID) V added in v0.0.8

func (g GID) V() bool

V returns true if a vertical rotation is in place

func (GID) Value added in v0.0.8

func (g GID) Value() uint32

Value returns the true GID value packed with rotation data

type Image added in v0.0.4

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

Image represents a ebiten image with added details on how to render

func (*Image) AddSlice added in v0.0.4

func (img *Image) AddSlice(s *Slice) error

AddSlice adds a 9slicing to an image

func (*Image) Name added in v0.0.4

func (img *Image) Name() string

Name returns the image name

func (*Image) RemoveSlice added in v0.0.4

func (img *Image) RemoveSlice(s *Slice) error

RemoveSlice removes 9slicing data from an image

func (*Image) Slice added in v0.0.4

func (img *Image) Slice(name string) (*Slice, error)

Slice returns a 9 slice based on name

type Interfacer

type Interfacer interface {
	//TargetPositionUpdate(tp *common.Vector, duration time.Duration)
	IsEnabled() bool
	SetEnabled(isEnabled bool)
	IsVisible() bool
	SetVisible(isVisible bool)

	Name() string
	RenderIndex() int64
	SetRenderIndex(renderIndex int64)
	IsDestroyed() bool
	SetIsDestroyed(isDestroyed bool)
	SetText(text string)
	// Shape returns the shape of an element
	Shape() *common.Rectangle
	// SetShape sets the shape of an element
	SetShape(shape common.Rectangle)
	LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, endFunc func())
	// contains filtered or unexported methods
}

Interfacer is a generic user interface wrapper

type Label

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

Label represents a UI label element

func (*Label) IsDestroyed

func (e *Label) IsDestroyed() bool

IsDestroyed returns true when the element is flagged for deletion

func (*Label) IsEnabled added in v0.0.4

func (e *Label) IsEnabled() bool

IsEnabled returns true if a button is enabled

func (*Label) IsVisible

func (e *Label) IsVisible() bool

IsVisible returns true if element should be shown

func (*Label) LerpColor

func (e *Label) LerpColor(endColor color.Color, duration time.Duration, isDestroyed bool, endFunc func())

LerpColor changes the label's color over duration

func (*Label) LerpPosition

func (e *Label) LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, endFunc func())

LerpPosition changes an element's position over duration

func (*Label) Name added in v0.0.4

func (e *Label) Name() string

Name returns an element's name

func (*Label) RenderIndex added in v0.0.4

func (e *Label) RenderIndex() int64

RenderIndex returns the render index of element

func (*Label) SetEnabled added in v0.0.4

func (e *Label) SetEnabled(isEnabled bool)

SetEnabled changes if a button is enabled

func (*Label) SetIsDestroyed added in v0.0.4

func (e *Label) SetIsDestroyed(isDestroyed bool)

SetIsDestroyed sets an element to be destroyed on next update

func (*Label) SetOnPressFunction

func (e *Label) SetOnPressFunction(f func())

SetOnPressFunction lets you pass a function without the need of label handling

func (*Label) SetOnPressed

func (e *Label) SetOnPressed(f func(e *Label))

SetOnPressed sets a label state

func (*Label) SetRenderIndex added in v0.0.4

func (e *Label) SetRenderIndex(renderIndex int64)

SetRenderIndex sets the render index of element

func (*Label) SetShape

func (e *Label) SetShape(shape common.Rectangle)

SetShape sets an element's X/Y position as well as width/height

func (*Label) SetText added in v0.0.4

func (e *Label) SetText(text string)

SetText changes the text on the label

func (*Label) SetVisible added in v0.0.4

func (e *Label) SetVisible(isVisible bool)

SetVisible changes the visibility of a button

func (*Label) Shape

func (e *Label) Shape() *common.Rectangle

Shape returns an element's X/Y position as well as width/height

type Map added in v0.0.7

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

Map represents a UI Map element

func (*Map) IsDestroyed added in v0.0.7

func (e *Map) IsDestroyed() bool

IsDestroyed returns true when the element is flagged for deletion

func (*Map) IsEnabled added in v0.0.7

func (e *Map) IsEnabled() bool

IsEnabled returns true if a map is enabled

func (*Map) IsVisible added in v0.0.7

func (e *Map) IsVisible() bool

IsVisible returns true if mob is visible

func (*Map) LerpPosition added in v0.0.7

func (e *Map) LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, endFunc func())

LerpPosition changes an element's position over duration

func (*Map) Name added in v0.0.7

func (e *Map) Name() string

Name returns a mob's name

func (*Map) RenderIndex added in v0.0.7

func (e *Map) RenderIndex() int64

RenderIndex returns the render index of element

func (*Map) SetData added in v0.0.7

func (e *Map) SetData(data MapData) error

SetData sets a map's data

func (*Map) SetEnabled added in v0.0.7

func (e *Map) SetEnabled(isEnabled bool)

SetEnabled changes if a map is enabled

func (*Map) SetIsDestroyed added in v0.0.7

func (e *Map) SetIsDestroyed(isDestroyed bool)

SetIsDestroyed sets an element to be destroyed on next update

func (*Map) SetOnPressFunction added in v0.0.7

func (e *Map) SetOnPressFunction(f func())

SetOnPressFunction lets you pass a function without the need of map handling

func (*Map) SetOnPressed added in v0.0.7

func (e *Map) SetOnPressed(f func(e *Map))

SetOnPressed sets a map state

func (*Map) SetRenderIndex added in v0.0.7

func (e *Map) SetRenderIndex(renderIndex int64)

SetRenderIndex sets the render index of element

func (*Map) SetShape added in v0.0.7

func (e *Map) SetShape(shape common.Rectangle)

SetShape sets an element's X/Y position as well as width/height

func (*Map) SetText added in v0.0.7

func (e *Map) SetText(text string)

SetText changes the text on the map

func (*Map) SetVisible added in v0.0.7

func (e *Map) SetVisible(isVisible bool)

SetVisible changes the visibility of a map

func (*Map) Shape added in v0.0.7

func (e *Map) Shape() *common.Rectangle

Shape returns an element's X/Y position as well as width/height

func (*Map) X added in v0.0.7

func (e *Map) X() float64

X returns the X position of a map

func (*Map) Y added in v0.0.7

func (e *Map) Y() float64

Y returns the Y position of a map

type MapCollider added in v0.0.7

type MapCollider struct {
	IsCollider bool    `json:"is_collider,omitempty"`
	Cost       float32 `json:"cost,omitempty"`
}

MapCollider is a boolean if a collider is true or not

type MapData added in v0.0.7

type MapData struct {
	Source          string `json:"source,omitempty"`
	Width           int64  `json:"width,omitempty"`
	Height          int64  `json:"height,omitempty"`
	TileWidth       int64  `json:"tile_width,omitempty"`
	TileHeight      int64  `json:"tile_height,omitempty"`
	TileCount       int64  `json:"tile_count,omitempty"`
	TileSheetWidth  int64
	TileSheetHeight int64
	TileFrames      []image.Rectangle
	Layers          []MapLayer    `json:"layers,omitempty"`
	Colliders       []MapCollider `json:"colliders,omitempty"`
}

MapData contains map related information

type MapLayer added in v0.0.7

type MapLayer struct {
	Name    string    `json:"name,omitempty"`
	Opacity float32   `json:"opacity,omitempty"`
	Tiles   []MapTile `json:"tiles,omitempty"`
}

MapLayer contains layer data

type MapTile added in v0.0.7

type MapTile struct {
	GID uint32 `json:"gid,omitempty"`
}

MapTile contains the Gid of a specified tile

func (MapTile) D added in v0.0.8

func (mt MapTile) D() bool

D returns true if diagonal flagged

func (MapTile) H added in v0.0.8

func (mt MapTile) H() bool

H reads if the tile should be changed horizontal

func (MapTile) Index added in v0.0.8

func (mt MapTile) Index() uint32

Index returns a map tile's index

func (MapTile) SetD added in v0.0.8

func (mt MapTile) SetD(val bool)

SetD changes the horizontal flag

func (MapTile) SetH added in v0.0.8

func (mt MapTile) SetH(val bool)

SetH changes the horizontal flag

func (MapTile) SetV added in v0.0.8

func (mt MapTile) SetV(val bool)

SetV changes the horizontal flag

func (MapTile) V added in v0.0.8

func (mt MapTile) V() bool

V returns true if a vertical rotation is in place

type Scene

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

Scene represents a layout of ui

func (*Scene) AddElement

func (s *Scene) AddElement(e Interfacer) error

AddElement adds an element to the scene list

func (*Scene) Element

func (s *Scene) Element(name string) (Interfacer, error)

Element returns an element based on name

func (*Scene) RemoveElement

func (s *Scene) RemoveElement(name string) error

RemoveElement flags an element to be removed next update

type Slice added in v0.0.4

type Slice struct {
	Name string      `xml:"id,attr"`
	Keys []*SliceKey `xml:"key"`
}

Slice represents a 9 slicing instruction set within an image

type SliceKey added in v0.0.4

type SliceKey struct {
	Frame  string  `xml:"frame,attr"`
	X      float64 `xml:"x,attr"`
	Y      float64 `xml:"y,attr"`
	W      float64 `xml:"w,attr"`
	H      float64 `xml:"h,attr"`
	CX     float64 `xml:"cx,attr"`
	CY     float64 `xml:"cy,attr"`
	CW     float64 `xml:"cw,attr"`
	CH     float64 `xml:"ch,attr"`
	PivotX float64 `xml:"px,attr"`
	PivotY float64 `xml:"py,attr"`
}

SliceKey represents each slice's key data

type Sprite added in v0.0.6

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

Sprite represents a UI Sprite element

func (*Sprite) Animation added in v0.0.6

func (e *Sprite) Animation() string

Animation returns the current played animation name

func (*Sprite) IsDestroyed added in v0.0.6

func (e *Sprite) IsDestroyed() bool

IsDestroyed returns true when the element is flagged for deletion

func (*Sprite) IsEnabled added in v0.0.6

func (e *Sprite) IsEnabled() bool

IsEnabled returns true if a sprite is enabled

func (*Sprite) IsVisible added in v0.0.6

func (e *Sprite) IsVisible() bool

IsVisible returns true if mob is visible

func (*Sprite) LerpPosition added in v0.0.6

func (e *Sprite) LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, endFunc func())

LerpPosition changes an element's position over duration

func (*Sprite) Name added in v0.0.6

func (e *Sprite) Name() string

Name returns a mob's name

func (*Sprite) RenderIndex added in v0.0.6

func (e *Sprite) RenderIndex() int64

RenderIndex returns the render index of element

func (*Sprite) SetAnimation added in v0.0.6

func (e *Sprite) SetAnimation(name string)

SetAnimation sets the current animation group name

func (*Sprite) SetEnabled added in v0.0.6

func (e *Sprite) SetEnabled(isEnabled bool)

SetEnabled changes if a sprite is enabled

func (*Sprite) SetIsDestroyed added in v0.0.6

func (e *Sprite) SetIsDestroyed(isDestroyed bool)

SetIsDestroyed sets an element to be destroyed on next update

func (*Sprite) SetOnPressFunction added in v0.0.6

func (e *Sprite) SetOnPressFunction(f func())

SetOnPressFunction lets you pass a function without the need of sprite handling

func (*Sprite) SetOnPressed added in v0.0.6

func (e *Sprite) SetOnPressed(f func(e *Sprite))

SetOnPressed sets a sprite state

func (*Sprite) SetRenderIndex added in v0.0.6

func (e *Sprite) SetRenderIndex(renderIndex int64)

SetRenderIndex sets the render index of element

func (*Sprite) SetShape added in v0.0.6

func (e *Sprite) SetShape(shape common.Rectangle)

SetShape sets an element's X/Y position as well as width/height

func (*Sprite) SetText added in v0.0.6

func (e *Sprite) SetText(text string)

SetText changes the text on the sprite

func (*Sprite) SetVisible added in v0.0.6

func (e *Sprite) SetVisible(isVisible bool)

SetVisible changes the visibility of a sprite

func (*Sprite) Shape added in v0.0.6

func (e *Sprite) Shape() *common.Rectangle

Shape returns an element's X/Y position as well as width/height

func (*Sprite) X added in v0.0.6

func (e *Sprite) X() float64

X returns the X position of a sprite

func (*Sprite) Y added in v0.0.6

func (e *Sprite) Y() float64

Y returns the Y position of a sprite

type UI

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

UI contains core game components

func NewUI

func NewUI(screenResolution image.Point, scale float64) (*UI, error)

NewUI instantiates a new User Interface

func (*UI) AddFont added in v0.0.4

func (u *UI) AddFont(font *Font) error

AddFont adds an font font to ui

func (*UI) AddImage added in v0.0.4

func (u *UI) AddImage(img *Image) error

AddImage adds an image image to ui

func (*UI) AddScene

func (u *UI) AddScene(name string, scene *Scene) error

AddScene appends a new scene to the UI

func (*UI) CurrentScene

func (u *UI) CurrentScene() *Scene

CurrentScene returns the current scene

func (*UI) DefaultFont added in v0.0.4

func (u *UI) DefaultFont(name string) error

DefaultFont returns the current default font

func (*UI) Font added in v0.0.4

func (u *UI) Font(name string) (*Font, error)

Font returns named font

func (*UI) Image added in v0.0.4

func (u *UI) Image(name string) (*Image, error)

Image returns a named image

func (*UI) NewButton

func (u *UI) NewButton(name string, scene string, text string, shape common.Rectangle, textColor color.Color, imageName string, pressedSliceName string, unpressedSliceName string) (*Button, error)

NewButton creates a new button instance

func (*UI) NewFontTTF added in v0.0.4

func (u *UI) NewFontTTF(name string, fontData []byte, opts *truetype.Options, r rune) (*Font, error)

NewFontTTF instantiates a truetype font. truetype.Parse() can be used to load a TTF to fontData

func (*UI) NewFrame

func (u *UI) NewFrame(name string, imageName string, text string, shape *common.Rectangle) (e *Frame, err error)

NewFrame creates a new Frame instance

func (*UI) NewImage added in v0.0.4

func (u *UI) NewImage(name string, f io.Reader, filter ebiten.Filter) (*Image, error)

NewImage adds a new image to egui

func (*UI) NewLabel

func (u *UI) NewLabel(name string, text string, shape common.Rectangle, color color.Color) (e *Label, err error)

NewLabel creates a new label instance

func (*UI) NewMap added in v0.0.7

func (u *UI) NewMap(name string, scene string, shape common.Rectangle, tintColor color.Color, imageName string) (*Map, error)

NewMap creates a new map instance

func (*UI) NewScene added in v0.0.5

func (ui *UI) NewScene(name string) (*Scene, error)

NewScene initializes a new scene

func (*UI) NewSprite added in v0.0.6

func (u *UI) NewSprite(name string, scene string, shape common.Rectangle, tintColor color.Color, imageName string) (*Sprite, error)

NewSprite creates a new sprite instance

func (*UI) RemoveFont added in v0.0.4

func (u *UI) RemoveFont(font *Font) error

RemoveFont is used to unload and remove a font

func (*UI) Resolution

func (u *UI) Resolution() image.Point

Resolution returns the resolution

func (*UI) Scene

func (u *UI) Scene(name string) (*Scene, error)

Scene gets a scene

func (*UI) SetCurrentScene

func (u *UI) SetCurrentScene(name string) error

SetCurrentScene sets current scene

func (*UI) SetDefaultFont added in v0.0.4

func (u *UI) SetDefaultFont(name string) error

SetDefaultFont updates all elements to use a new default font

func (*UI) SetResolution

func (u *UI) SetResolution(resolution image.Point)

SetResolution changes the resolution of the UI

func (*UI) Update

func (u *UI) Update(image *ebiten.Image) error

Update updates all UI elements

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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