misc

package
v1.0.0-alpha.111 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionButton

type ActionButton struct {
	World  *engine.World
	Entity *engine.Entity

	Target      mixins.TargetSelection
	Invert      bool
	SendPress   bool
	SendRelease bool
	SendHold    bool

	State bool
}

ActionButton sends a signal along when action button is pressed/released.

func (*ActionButton) Despawn

func (g *ActionButton) Despawn()

func (*ActionButton) Spawn

func (g *ActionButton) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*ActionButton) Touch

func (g *ActionButton) Touch(other *engine.Entity)

func (*ActionButton) Update

func (g *ActionButton) Update()

type Animation

type Animation struct {
	SpriteBase
	Entity *engine.Entity
	Anim   animation.State
}

Animation is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque.

func (*Animation) Spawn

func (a *Animation) Spawn(w *engine.World, s *level.Spawnable, e *engine.Entity) error

func (*Animation) Update

func (a *Animation) Update()

type ExitButton

type ExitButton struct {
	SwitchableSprite
}

ExitButton shows as Esc key or Start button depending on input device.

func (*ExitButton) Spawn

func (s *ExitButton) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

type MovableSprite

type MovableSprite struct {
	Sprite
	mixins.Movable
}

MovableSprite is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque. Can be toggled from outside and will move back/forth.

func (*MovableSprite) Spawn

func (s *MovableSprite) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*MovableSprite) Update

func (s *MovableSprite) Update()

type MovingAnimation

type MovingAnimation struct {
	Animation
	mixins.Moving
	mixins.Fadable
	mixins.NonSolidTouchable

	World  *engine.World
	Entity *engine.Entity

	Alpha          float64
	FadeOnTouch    bool
	RespawnOnTouch bool
	StopOnTouch    bool

	FramesToMove int
	FramesToFade int
}

MovingAnimation is a simple entity type that moves in a specified direction. Optionally despawns when hitting solid.

func (*MovingAnimation) Spawn

func (s *MovingAnimation) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*MovingAnimation) Touch

func (s *MovingAnimation) Touch(other *engine.Entity)

func (*MovingAnimation) Update

func (s *MovingAnimation) Update()

type Sprite

type Sprite struct {
	SpriteBase
}

Sprite is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque.

func (*Sprite) Precache

func (s *Sprite) Precache(sp *level.Spawnable) error

func (*Sprite) Spawn

func (s *Sprite) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

type SpriteBase

type SpriteBase struct {
	ZDefault int
}

SpriteBase is a base class for sprites. To instantiate it, just set the entity image, then forward to this.

func (*SpriteBase) Despawn

func (s *SpriteBase) Despawn()

func (*SpriteBase) Spawn

func (s *SpriteBase) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*SpriteBase) Touch

func (s *SpriteBase) Touch(other *engine.Entity)

func (*SpriteBase) Update

func (s *SpriteBase) Update()

type SwitchableAnimation

type SwitchableAnimation struct {
	Animation
	mixins.Fadable
}

SwitchableAnimation is a simple entity type that renders an animation. Can be toggled from outside.

func (*SwitchableAnimation) Spawn

func (*SwitchableAnimation) Update

func (s *SwitchableAnimation) Update()

type SwitchableSprite

type SwitchableSprite struct {
	Sprite
	mixins.Fadable
}

SwitchableSprite is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque. Can be toggled from outside.

func (*SwitchableSprite) Spawn

func (*SwitchableSprite) Update

func (s *SwitchableSprite) Update()

type SwitchableText

type SwitchableText struct {
	Text
	mixins.Fadable
}

SwitchableText is a simple entity type that renders text. Can be toggled from outside.

func (*SwitchableText) SetState

func (s *SwitchableText) SetState(originator, predecessor *engine.Entity, state bool)

func (*SwitchableText) Spawn

func (s *SwitchableText) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*SwitchableText) Update

func (s *SwitchableText) Update()

type Text

type Text struct {
	SpriteBase

	World  *engine.World
	Entity *engine.Entity

	Key     textCacheKey
	MyImage bool
}

Text is a simple entity type that renders text.

func (*Text) Despawn

func (t *Text) Despawn()

func (*Text) Precache

func (t *Text) Precache(s *level.Spawnable) error

func (*Text) Spawn

func (t *Text) Spawn(w *engine.World, s *level.Spawnable, e *engine.Entity) error

Jump to

Keyboard shortcuts

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