canvas

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {

	// Chunks
	Chunks []Chunk
	// contains filtered or unexported fields
}

func GetById

func GetById(id string) (*Canvas, error)

func New

func New(isCreate bool) (*Canvas, error)

func (*Canvas) AddEventListner

func (c *Canvas) AddEventListner(eventType string, handler func(this js.Value, p []js.Value) interface{})

func (*Canvas) Clear

func (c *Canvas) Clear()

func (*Canvas) DrawBorderChunk

func (c *Canvas) DrawBorderChunk(x, y, width, height int, color string)

func (*Canvas) DrawFillChunk

func (c *Canvas) DrawFillChunk(x, y, width, height int, color string, isBorder bool)

func (*Canvas) DrawGrid

func (c *Canvas) DrawGrid(rows, cols, cellWidth, cellHeight int)

func (*Canvas) DrawImage

func (c *Canvas) DrawImage(x, y, width, height int, src string)

func (*Canvas) Resize

func (c *Canvas) Resize(width, height int)

type Chunk

type Chunk struct {
	X      int
	Y      int
	Width  int
	Height int
	Row    int
	Col    int
	Color  string
}

Jump to

Keyboard shortcuts

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