intswitch

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

intswitch

The intswitch package contains a render.Switch alternative keyed on ints instead of strings.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Switch

type Switch struct {
	render.LayeredPoint

	Index int
	// contains filtered or unexported fields
}

The Switch type will display one of a set of modifiable sub-components, keyed on integers. Consider using it with bitflags.

func New

func New(start int, m map[int]render.Modifiable) *Switch

New creates a new Switch from a map of values to modifiables

func (*Switch) Add

func (c *Switch) Add(k int, v render.Modifiable) (err error)

Add makes a new entry in the Switch's map. If the key already existed, it will be overwritten and an error will be returned.

func (*Switch) Copy

func (c *Switch) Copy() render.Modifiable

Copy creates a copy of the Switch

func (*Switch) Draw

func (c *Switch) Draw(buff draw.Image, xOff float64, yOff float64)

Draw draws the Switch at an offset from its logical location

func (*Switch) Filter

func (c *Switch) Filter(fs ...mod.Filter)

Filter filters all elements of the Switch with fs

func (*Switch) Get

func (c *Switch) Get() int

Get returns the Switch's current key

func (*Switch) GetDims

func (c *Switch) GetDims() (int, int)

GetDims gets the current Renderables dimensions

func (*Switch) GetRGBA

func (c *Switch) GetRGBA() *image.RGBA

GetRGBA returns the current renderables rgba

func (*Switch) GetSub

func (c *Switch) GetSub(s int) render.Modifiable

GetSub returns a keyed Modifiable from this Switch's map

func (*Switch) IsInterruptable

func (c *Switch) IsInterruptable() bool

IsInterruptable returns whether the current renderable is interruptable

func (*Switch) IsStatic

func (c *Switch) IsStatic() bool

IsStatic returns whether the current renderable is static

func (*Switch) Modify

func (c *Switch) Modify(ms ...mod.Mod) render.Modifiable

Modify performs the input modifications on all elements of the Switch

func (*Switch) Pause

func (c *Switch) Pause()

Pause stops the current Renderable if possible

func (*Switch) Revert

func (c *Switch) Revert(mod int)

Revert will revert all parts of this Switch that can be reverted

func (*Switch) RevertAll

func (c *Switch) RevertAll()

RevertAll will revert all parts of this Switch that can be reverted, back to their original state.

func (*Switch) Set

func (c *Switch) Set(k int) error

Set sets the current renderable to the one specified

func (*Switch) SetOffsets

func (c *Switch) SetOffsets(k int, offsets physics.Vector)

SetOffsets sets the logical offset for the specified key

func (*Switch) SetTriggerID

func (c *Switch) SetTriggerID(cid event.CID)

SetTriggerID sets the ID AnimationEnd will trigger on for animating subtypes. Todo: standardize this with the other interface Set functions so that it also only acts on the current subRenderable, or the other way around, or somehow offer both options

func (*Switch) ShiftPos

func (c *Switch) ShiftPos(x, y float64)

ShiftPos shifts the Switch's logical position

func (*Switch) Unpause

func (c *Switch) Unpause()

Unpause tries to unpause the current Renderable if possible

Jump to

Keyboard shortcuts

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