sprite

package
v0.0.0-...-e7326f8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sprite

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

Allows to draw sprites on the screen. It supports some featuares such as: sprite color, pivoting, visibility.

func New

func New(tf interfaces.ITransform, img *ebiten.Image) *Sprite

Creates a new sprite. Sprite allows to draw sprites on the screen. It supports some featuares such as: sprite color, pivoting, visibility.

func (*Sprite) Draw

func (s *Sprite) Draw(game interfaces.IGameBase, screen *ebiten.Image)

func (*Sprite) DrawPriority

func (s *Sprite) DrawPriority() float64

func (*Sprite) GetBoudingBox

func (s *Sprite) GetBoudingBox() (bbA, bbB *vector2.Vector2)

Get the bounding box of the sprite.

func (*Sprite) GetID

func (s *Sprite) GetID() string

Implementation of the goi.Component

func (*Sprite) GetImage

func (s *Sprite) GetImage() *ebiten.Image

Returns current image of the sprite.

func (*Sprite) GetImageSize

func (s *Sprite) GetImageSize() *vector2.Vector2

Get size of the image.

func (*Sprite) GetOptions

func (s *Sprite) GetOptions() *interfaces.SpriteOptions

Returns options of the sprite.

func (*Sprite) GetPivot

func (s *Sprite) GetPivot() *vector2.Vector2

Returns a pivot of the sprite.

func (*Sprite) GetPivotOpposite

func (s *Sprite) GetPivotOpposite() *vector2.Vector2

Returns an opposite value of the sprite pivot.

func (*Sprite) GetPivotOppositeScaled

func (s *Sprite) GetPivotOppositeScaled() *vector2.Vector2

Returns an scaled opposite value of the sprite pivot. Multiplies opposite value of the pivot by the scale of the transform.

func (*Sprite) GetPivotScaled

func (s *Sprite) GetPivotScaled() *vector2.Vector2

Returns a scaled pivot of the sprite. Mulitplies pivot by the scale of the transform.

func (*Sprite) GetTransform

func (s *Sprite) GetTransform() interfaces.ITransform

Returns the transform that this component is using.

func (*Sprite) SetColor

func (s *Sprite) SetColor(c color.Color)

Changes color of the sprite. By default is white. This color doesn't changes the color of the image.

func (*Sprite) SetImage

func (s *Sprite) SetImage(image *ebiten.Image)

Set a image of the sprite.

func (*Sprite) SetOptions

func (s *Sprite) SetOptions(opts *interfaces.SpriteOptions)

Set options of the sprite.

func (*Sprite) SetPivot

func (s *Sprite) SetPivot(pivot *vector2.Vector2)

Changes pivot of the sprite.

func (*Sprite) SetVisible

func (s *Sprite) SetVisible(v bool)

Changes visiblity of the sprite.

Jump to

Keyboard shortcuts

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