painter

package
v0.0.0-...-5736fe5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResetOp = Reset{}

ResetOp операція очищує вікно

View Source
var UpdateOp = Update{}

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

Functions

This section is empty.

Types

type Bgrect

type Bgrect struct {
	X1 float32
	Y1 float32
	X2 float32
	Y2 float32
}

Bgrect операція додає чорний прямокутник на екран в певних координатах

func (Bgrect) Do

func (op Bgrect) Do(t screen.Texture)

func (Bgrect) Update

func (op Bgrect) Update(state *State)

type Figure

type Figure struct {
	X float32
	Y float32
}

Figure операція додає фігуру варіанту на вказані координати

func (Figure) Do

func (op Figure) Do(texture screen.Texture)

func (Figure) Update

func (op Figure) Update(state *State)

type Fill

type Fill struct {
	Color color.Color
}

Fill зафарбовує текстуру у відповідний колір

func (Fill) Do

func (op Fill) Do(texture screen.Texture)

func (Fill) Update

func (op Fill) Update(state *State)

type Loop

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

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

func (*Loop) Post

func (eventLoop *Loop) Post(operations OperationList)

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

func (*Loop) Start

func (eventLoop *Loop) Start(screenDevice screen.Screen)

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

type MessageQueue

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

MessageQueue — черга повідомлень

func (*MessageQueue) Pull

func (messageQueue *MessageQueue) Pull() Operation

func (*MessageQueue) Push

func (messageQueue *MessageQueue) Push(operation Operation)

type Move

type Move struct {
	X float32
	Y float32
}

Move операція переміщує усі на відповідну кількість пікселів

func (Move) Update

func (op Move) Update(state *State)

type Operation

type Operation interface {
	Update(state *State)
}

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

type OperationList

type OperationList []Operation

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

type Receiver

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

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

type Reset

type Reset struct{}

func (Reset) Update

func (op Reset) Update(state *State)

type State

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

type Update

type Update struct{}

func (Update) Update

func (op Update) Update(_ *State)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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