game_ui

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Color

func Color(code uint32) *color.Color

func ColorCode1

func ColorCode1(code uint32) *[4]color.Color

func ColorCodeGradation

func ColorCodeGradation(topLeft, topRight, bottomRight, bottomLeft uint32) *[4]color.Color

func ColorCodeHorizontal

func ColorCodeHorizontal(left, right uint32) *[4]color.Color

func ColorCodeVertical

func ColorCodeVertical(top, bottom uint32) *[4]color.Color

func Px

func Px(value int, calc ...sizeSeg) *sizeSeg

func Radius1

func Radius1(px int) *[4]int

func Radius4

func Radius4(topLeft, topRight, bottomRight, bottomLeft int) *[4]int

func Size1

func Size1(size *sizeSeg) *[4]sizeSeg

func Size2

func Size2(vertical, horizontal *sizeSeg) *[4]sizeSeg

func Size3

func Size3(top, horizontal, bottom *sizeSeg) *[4]sizeSeg

func Size4

func Size4(top, right, bottom, left *sizeSeg) *[4]sizeSeg

func Vh

func Vh(value float32, calc ...sizeSeg) *sizeSeg

func Vw

func Vw(value float32, calc ...sizeSeg) *sizeSeg

Types

type Component

type Component interface {
	GetSize() image.Point
	Draw(screen *ebiten.Image, x, y int)
	IsFloating() bool
	Components() []Component
	Area() image.Rectangle
}

type DirectionType

type DirectionType = string
const (
	Horizontal DirectionType = "horizontal"
	Vertical   DirectionType = "vertical"
)

type PositionType

type PositionType = string
const (
	First  PositionType = "first"
	Center PositionType = "center"
	Last   PositionType = "last"
)

type Text

type Text = *textComponent

func NewText

func NewText(str string, styles ...TextStyle) Text

func (Text) Area

func (t Text) Area() image.Rectangle

func (Text) ChangeText

func (t Text) ChangeText(text string)

func (Text) Components

func (t Text) Components() []Component

func (Text) Draw

func (t Text) Draw(screen *ebiten.Image, x, y int)

func (Text) GetSize

func (t Text) GetSize() image.Point

func (Text) IsFloating

func (t Text) IsFloating() bool

type TextFont

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

func NewTextFont

func NewTextFont(face font.Face, xAdjustment int, yAdjustment int) TextFont

type TextStyle

type TextStyle struct {
	Color      *color.Color
	LineHeight *sizeSeg
	Font       *TextFont
	Width      *sizeSeg
}

type View

type View = *viewComponent

func NewView

func NewView(components []Component, styles ...ViewStyle) View

func (View) Area

func (v View) Area() image.Rectangle

func (View) Components

func (v View) Components() []Component

func (View) Draw

func (v View) Draw(screen *ebiten.Image, x, y int)

func (View) GetSize

func (v View) GetSize() image.Point

func (View) GetStylesCount

func (v View) GetStylesCount() int

func (View) IsFloating

func (v View) IsFloating() bool

func (View) PopStyle

func (v View) PopStyle()

func (View) PushStyle

func (v View) PushStyle(style ViewStyle)

func (View) ReplaceStyle

func (v View) ReplaceStyle(position int, style ViewStyle)

type ViewStyle

type ViewStyle struct {
	/* top_left top_right bottom_right bottom_left */
	BackgroundColor, BorderColor *[4]color.Color
	/* top right bottom left */
	Padding, Margin, BorderWidth *[4]sizeSeg
	/* top_left top_right bottom_right bottom_left */
	Radius             *[4]int
	Width, Height      *sizeSeg
	Direction          *DirectionType
	PositionHorizontal *PositionType
	PositionVertical   *PositionType
	IsFloating         bool
}

type Window

type Window = *windowComponent

func NewWindow

func NewWindow(components []Component) Window

func (Window) Components

func (w Window) Components() []Component

func (Window) Draw

func (w Window) Draw(screen *ebiten.Image, x, y int)

func (Window) GetSize

func (w Window) GetSize() image.Point

func (Window) IsFloating

func (w Window) IsFloating() bool

Jump to

Keyboard shortcuts

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