painter

package
v0.0.0-...-20ec07e Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UpdateOp = updateOp{}

UpdateOp операція, яка не змінює текстуру, але сигналізує, що текстуру потрібно розглядати як готову.

Functions

func GreenFill

func GreenFill(tx screen.Texture)

GreenFill зафарбовує тестуру у зелений колір.

func ResetScreen

func ResetScreen(tx screen.Texture)

ResetScreen зафарбовує тестуру у чорний колір.

func WhiteFill

func WhiteFill(tx screen.Texture)

WhiteFill зафарбовує тестуру у білий колір.

Types

type BgRect

type BgRect struct {
	X1, Y1, X2, Y2 float32
}

func (*BgRect) Do

func (op *BgRect) Do(tx screen.Texture) bool

type Figure

type Figure struct {
	X, Y float32
	C    color.RGBA
}

func (*Figure) Do

func (op *Figure) Do(tx screen.Texture) bool

type Loop

type Loop struct {
	Receiver Receiver
	// contains filtered or unexported fields
}

Loop реалізує цикл подій для формування текстури отриманої через виконання операцій отриманих з внутрішньої черги.

func (*Loop) Post

func (l *Loop) Post(op Operation)

Post додає нову операцію у внутрішню чергу.

func (*Loop) Start

func (l *Loop) Start(s screen.Screen)

Start запускає цикл подій. Цей метод потрібно запустити до того, як викликати на ньому будь-які інші методи.

func (*Loop) StopAndWait

func (l *Loop) StopAndWait()

StopAndWait сигналізує

type Move

type Move struct {
	X, Y    float32
	Figures []*Figure
}

func (*Move) Do

func (op *Move) Do(tx screen.Texture) bool

type Operation

type Operation interface {
	// Do виконує зміну операції, повертаючи true, якщо текстура вважається готовою для відображення.
	Do(tx screen.Texture) (ready bool)
}

Operation змінює вхідну текстуру.

type OperationFunc

type OperationFunc func(t screen.Texture)

OperationFunc використовується для перетворення функції оновлення текстури в Operation.

func (OperationFunc) Do

func (f OperationFunc) Do(tx screen.Texture) bool

type OperationList

type OperationList []Operation

OperationList групує список операції в одну.

func (OperationList) Do

func (opList OperationList) Do(tx screen.Texture) (ready bool)

type Receiver

type Receiver interface {
	Update(t screen.Texture)
}

Receiver отримує текстуру, яка була підготовлена в результаті виконання команд у циелі подій.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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