senses

package module
v0.0.0-...-0a6355e Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

README

senses

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawRectangle

func DrawRectangle(image *ebiten.Image, position *Position, size *Size, color *color.NRGBA)

func SaveSymbol

func SaveSymbol()

func SymbolMain

func SymbolMain()

Types

type Container

type Container struct {
	*Visual
	Theme       *Theme
	Widgets     []Widget
	Orientation Orientation
	GrowAdder   float64
}

func NewContainer

func NewContainer(orientation Orientation, theme *Theme) *Container

func (*Container) Add

func (container *Container) Add(widget Widget)

func (*Container) Arrange

func (container *Container) Arrange()

func (*Container) Draw

func (container *Container) Draw(screen *ebiten.Image)

type Font

type Font struct {
	Name            string
	Symbols         map[rune]*Symbol
	Source          string
	DescriptionPath string
	SymbolSize      int
	SizeFactor      int
	RealSize        int
}

func LoadFont

func LoadFont(fontsDirectory, descriptionFileName string) *Font

func (*Font) LoadSymbol

func (font *Font) LoadSymbol(symbolPath string, symbolName string)

type Orientation

type Orientation int
const (
	Vertical Orientation = iota
	Horizontal
)

type Position

type Position struct {
	X int
	Y int
}

func NewPosition

func NewPosition(x, y int) *Position

func (*Position) Update

func (position *Position) Update(x, y int)

func (*Position) UpdateFrom

func (position *Position) UpdateFrom(other *Position)

type Size

type Size struct {
	Width  int
	Height int
}

func NewSize

func NewSize(width, height int) *Size

func (*Size) Update

func (size *Size) Update(width, height int)

func (*Size) UpdateFrom

func (size *Size) UpdateFrom(other *Size)

type Symbol

type Symbol struct {
	Size  Size
	Units [][]bool
}

type SymbolGame

type SymbolGame struct {
}

func (*SymbolGame) Draw

func (g *SymbolGame) Draw(screen *ebiten.Image)

func (*SymbolGame) Layout

func (g *SymbolGame) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)

func (*SymbolGame) Update

func (g *SymbolGame) Update(screen *ebiten.Image) error

type TextVisual

type TextVisual struct {
	*Visual
	Text string
}

func NewTextVisual

func NewTextVisual(text string, theme *Theme) *TextVisual

func (*TextVisual) Draw

func (textVisual *TextVisual) Draw(screen *ebiten.Image)

func (*TextVisual) DrawRune

func (textVisual *TextVisual) DrawRune(screen *ebiten.Image, r rune, x0, y0 int)

type Theme

type Theme struct {
	BackgroundColor *color.NRGBA
	ForegroundColor *color.NRGBA
	Font            *Font
}

func NewTheme

func NewTheme(font *Font, backgroundColor, foregroundColor *color.NRGBA) *Theme

type Visual

type Visual struct {
	Theme      *Theme
	Proportion float64
	// contains filtered or unexported fields
}

func NewVisual

func NewVisual(theme *Theme) *Visual

func (*Visual) Arrange

func (visual *Visual) Arrange()

func (*Visual) Draw

func (visual *Visual) Draw(screen *ebiten.Image)

func (*Visual) GrowRatio

func (visual *Visual) GrowRatio() float64

func (*Visual) Position

func (visual *Visual) Position() *Position

func (*Visual) Size

func (visual *Visual) Size() *Size

type Widget

type Widget interface {
	Arrange()
	GrowRatio() float64
	Draw(image *ebiten.Image)
	Position() *Position
	Size() *Size
}

type Window

type Window struct {
	Title     string
	Size      *Size
	Container *Container
	Theme     *Theme
}

func NewWindow

func NewWindow(title string, width int, height int) *Window

func (*Window) Draw

func (window *Window) Draw(screen *ebiten.Image)

func (*Window) Layout

func (window *Window) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)

func (*Window) SetContainer

func (window *Window) SetContainer(container *Container)

func (*Window) Show

func (window *Window) Show()

func (*Window) Update

func (window *Window) Update(screen *ebiten.Image) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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