painter

package
v0.0.0-...-ab69035 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(t screen.Texture)

Clear очищує текстуру та зафарбовує у чорний колір. Може бути викоистана як Operation через OperationFunc(Clear)

func GreenFill

func GreenFill(t screen.Texture)

GreenFill зафарбовує тестуру у зелений колір. Може бути використана як Operation через OperationFunc(GreenFill)

func WhiteFill

func WhiteFill(t screen.Texture)

WhiteFill зафарбовує текстуру у білий колір. Може бути використана як Operation через OperationFunc(WhiteFill)

Types

type FigureOperation

type FigureOperation struct{ CordX, CordY int }

func (FigureOperation) Do

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 MoveOperation

type MoveOperation struct{ X, Y int }

func (MoveOperation) Do

func (m MoveOperation) Do(t screen.Texture) bool

type Operation

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

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

type OperationFunc

type OperationFunc func(t screen.Texture)

OperationFunc перетворює функцію оновлення текстури в Operation

func (OperationFunc) Do

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

type OperationList

type OperationList []Operation

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

func (OperationList) Do

func (ol OperationList) Do(t screen.Texture) (ready bool)

type Receiver

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

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

type RectOperation

type RectOperation struct{ X1, Y1, X2, Y2 int }

func (RectOperation) Do

func (rectOp RectOperation) Do(t screen.Texture) bool

type State

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

State зберігає поточний стан фігури

type UpdateOp

type UpdateOp struct{}

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

func (UpdateOp) Do

func (op UpdateOp) Do(t screen.Texture) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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