Documentation ¶
Index ¶
- type Sprite
- func (s *Sprite) Draw(game interfaces.IGameBase, screen *ebiten.Image)
- func (s *Sprite) DrawPriority() float64
- func (s *Sprite) GetBoudingBox() (bbA, bbB *vector2.Vector2)
- func (s *Sprite) GetID() string
- func (s *Sprite) GetImage() *ebiten.Image
- func (s *Sprite) GetImageSize() *vector2.Vector2
- func (s *Sprite) GetOptions() *interfaces.SpriteOptions
- func (s *Sprite) GetPivot() *vector2.Vector2
- func (s *Sprite) GetPivotOpposite() *vector2.Vector2
- func (s *Sprite) GetPivotOppositeScaled() *vector2.Vector2
- func (s *Sprite) GetPivotScaled() *vector2.Vector2
- func (s *Sprite) GetTransform() interfaces.ITransform
- func (s *Sprite) SetColor(c color.Color)
- func (s *Sprite) SetImage(image *ebiten.Image)
- func (s *Sprite) SetOptions(opts *interfaces.SpriteOptions)
- func (s *Sprite) SetPivot(pivot *vector2.Vector2)
- func (s *Sprite) SetVisible(v bool)
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 (*Sprite) GetBoudingBox ¶
Get the bounding box of the sprite.
func (*Sprite) GetImage ¶
func (s *Sprite) GetImage() *ebiten.Image
Returns current image of the sprite.
func (*Sprite) GetImageSize ¶
Get size of the image.
func (*Sprite) GetOptions ¶
func (s *Sprite) GetOptions() *interfaces.SpriteOptions
Returns options of the sprite.
func (*Sprite) GetPivotOpposite ¶
Returns an opposite value of the sprite pivot.
func (*Sprite) GetPivotOppositeScaled ¶
Returns an scaled opposite value of the sprite pivot. Multiplies opposite value of the pivot by the scale of the transform.
func (*Sprite) GetPivotScaled ¶
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 ¶
Changes color of the sprite. By default is white. This color doesn't changes the color of the image.
func (*Sprite) SetOptions ¶
func (s *Sprite) SetOptions(opts *interfaces.SpriteOptions)
Set options of the sprite.