ui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BorderColor = color.White
View Source
var EmptyColor = color.White
View Source
var HighlightColor = color.RGBA{
	R: 236,
	G: 168,
	B: 105,
	A: 255,
}
View Source
var MissColor = color.RGBA{
	R: 60,
	G: 64,
	B: 72,
	A: 255,
}
View Source
var MutedColor = color.Gray16{Y: 0xaaff}
View Source
var ShipColor = color.RGBA{
	R: 83,
	G: 127,
	B: 231,
	A: 255,
}
View Source
var ShipHitColor = color.RGBA{
	R: 245,
	G: 80,
	B: 80,
	A: 255,
}
View Source
var TextDarkColor = color.Black
View Source
var TextLightColor = color.White

Functions

func DrawCenteredText

func DrawCenteredText(screen *ebiten.Image, font font.Face, s string, px, py int, clr color.Color)

func DrawTopCenterText

func DrawTopCenterText(screen *ebiten.Image, font font.Face, s string, px, py int, clr color.Color)

func DrawTopLeftText

func DrawTopLeftText(screen *ebiten.Image, font font.Face, s string, px, py int, clr color.Color)

Types

type Button

type Button struct {
	core.BaseGameObject
	// contains filtered or unexported fields
}

func NewButton

func NewButton(pos data.Point[float32], width float32, height float32, text string, fontFace font.Face) *Button

func (*Button) Clicked

func (b *Button) Clicked() bool

func (*Button) CursorPointer

func (b *Button) CursorPointer() bool

func (*Button) Disable

func (b *Button) Disable()

func (*Button) Draw

func (b *Button) Draw(screen *ebiten.Image)

func (*Button) Update

func (b *Button) Update(cp data.Point[float32])

type Label

type Label struct {
	core.BaseGameObject
	// contains filtered or unexported fields
}

func NewLabel

func NewLabel(pos data.Point[float32], text string, fontFace font.Face) *Label

func (*Label) Draw

func (l *Label) Draw(screen *ebiten.Image)

func (*Label) SetAlignment

func (l *Label) SetAlignment(alignment LabelAlignment)

func (*Label) SetText

func (l *Label) SetText(text string)

type LabelAlignment

type LabelAlignment int
const (
	LabelAlignmentCenter LabelAlignment
	LabelAlignmentTopLeft
	LabelAlignmentTopCenter
)

Jump to

Keyboard shortcuts

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