painter

package
v0.0.0-...-d3236f7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UpdateOp = updateOp{}

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

Functions

func GreenFill

func GreenFill(t screen.Texture)

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

func ResetWindow

func ResetWindow(t screen.Texture)

func WhiteFill

func WhiteFill(t screen.Texture)

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

Types

type BgRect

type BgRect struct {
	XPOS1, YPOS1, XPOS2, YPOS2 int
}

func (*BgRect) Do

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

type Figure

type Figure struct {
	XPOS, YPOS int
	C          color.RGBA
}

func (*Figure) Do

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

type Loop

type Loop struct {
	Receiver Receiver

	MsgQueue MessageQueue
	// contains filtered or unexported fields
}

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

func (*Loop) Post

func (l *Loop) Post(op Operation)

func (*Loop) Start

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

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

func (*Loop) StopAndWait

func (l *Loop) StopAndWait()

StopAndWait сигналізує

type MessageQueue

type MessageQueue struct {
	Queue []Operation
	// contains filtered or unexported fields
}

func (*MessageQueue) IsEmpty

func (mq *MessageQueue) IsEmpty() bool

func (*MessageQueue) Pull

func (mq *MessageQueue) Pull() Operation

func (*MessageQueue) Push

func (mq *MessageQueue) Push(op Operation)

type MoveOp

type MoveOp struct {
	XPOS, YPOS int
	Figures    []*Figure
}

func (*MoveOp) Do

func (op *MoveOp) 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 отримує текстуру, яка була підготовлена в результаті виконання команд у циелі подій.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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