Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RenderPositions ¶
type RenderPositions string
RenderPositions defines anchor positions
const ( //CenterCenter center of sprite CenterCenter RenderPositions = "CENTER" //TopLeft topleft of sprite TopLeft RenderPositions = "LEFT" )
type SpriteMover ¶
type SpriteMover struct {
// contains filtered or unexported fields
}
SpriteMover moves a sprite by a given velocity to a defined direction
func NewSpriteMover ¶
func NewSpriteMover(container *sh2d.GameObject, direction geometry2d.Vector2D, velocity float64) *SpriteMover
NewSpriteMover creates a new sprite mover
type SpriteRenderer ¶
type SpriteRenderer struct { Texture *ebiten.Image Anchor *RenderPositions Scale *float64 // contains filtered or unexported fields }
SpriteRenderer is a component to render a sprite
func NewSpriteRenderer ¶
func NewSpriteRenderer(texture []byte, container *sh2d.GameObject, anchor RenderPositions) *SpriteRenderer
NewSpriteRenderer creates a new sprite renderer
func (*SpriteRenderer) Draw ¶
func (sp *SpriteRenderer) Draw(screen *ebiten.Image) error
Draw draws the component.
func (*SpriteRenderer) GetAbsCenter ¶
func (sp *SpriteRenderer) GetAbsCenter() geometry2d.Vector2D
GetAbsCenter gets centered absolute coordinates
func (*SpriteRenderer) GetAbsTopCenter ¶
func (sp *SpriteRenderer) GetAbsTopCenter() geometry2d.Vector2D
GetAbsTopCenter gets absolute coordinates of top center
func (*SpriteRenderer) GetRelCenter ¶
func (sp *SpriteRenderer) GetRelCenter() geometry2d.Vector2D
GetRelCenter gets centered relative coordinates
func (*SpriteRenderer) Update ¶
func (sp *SpriteRenderer) Update(delta int64) error
Update updates the component.
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer executes an event method when timer elapses
func NewTimerSingle ¶
NewTimerSingle creates a new timer that executes once.(Start manually)
func NewTimerSingleStart ¶
NewTimerSingleStart creates and starts a new timer to execute once