sprite

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package sprite - sprite object for drawing/moving on tcg.Buffer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sprite

type Sprite struct {
	Buf tcg.Buffer // sprite image
	// contains filtered or unexported fields
}

Sprite - sprite object

func New

func New(buf tcg.Buffer) *Sprite

New - get new sprite object from tcg.Buffer

func (*Sprite) Move

func (s *Sprite) Move(buf tcg.Buffer, x, y int) *Sprite

Move - move sprite on buffer to relative position

func (*Sprite) MoveAbs

func (s *Sprite) MoveAbs(buf tcg.Buffer, x, y int) *Sprite

MoveAbs - move sprite on buffer to absolute position, coordinates can be negative

func (*Sprite) Put

func (s *Sprite) Put(buf tcg.Buffer) *Sprite

Put - put sprite on buffer, save background under sprite, change state of sprite to drawn

func (*Sprite) WithMask

func (s *Sprite) WithMask(mask tcg.Buffer) *Sprite

WithMask - add mask to sprite

func (*Sprite) Withdraw

func (s *Sprite) Withdraw(buf tcg.Buffer) *Sprite

Withdraw - withdraw sprite from buffer

Jump to

Keyboard shortcuts

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