misc

package
v1.5.54 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearPrecache added in v1.2.141

func ClearPrecache()

Types

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, sp *level.SpawnableProps, e *engine.Entity) error

func (*Animation) Update

func (a *Animation) Update()

type CoverSprite

type CoverSprite struct {
	Sprite
}

CoverSprite is a Sprite with a high Z index. Use seldomly!

func (*CoverSprite) Spawn

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.SpawnableProps, 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 (*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 (*MovingAnimation) Touch

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

func (*MovingAnimation) Update

func (s *MovingAnimation) Update()

type SpawnCounter

type SpawnCounter struct{}

SpawnCounter triggers a target if it's been spawned a certain amount of times.

func (*SpawnCounter) Despawn

func (s *SpawnCounter) Despawn()

func (*SpawnCounter) Spawn

func (*SpawnCounter) Touch

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

func (*SpawnCounter) Update

func (s *SpawnCounter) 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.SpawnableProps, 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.SpawnableProps, 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 (*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(sp *level.Spawnable) error

func (*Text) Spawn

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

Jump to

Keyboard shortcuts

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