components

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaskPosition = uint64(1 << 0)
	MaskSize     = uint64(1 << 1)
	MaskVelocity = uint64(1 << 2)
)

Variables

This section is empty.

Functions

func NewPosition

func NewPosition() entity.Component

NewPosition ...

func NewSize

func NewSize() entity.Component

NewSize ...

func NewVelocity

func NewVelocity() entity.Component

NewVelocity ...

Types

type Position

type Position struct {
	ID string  `json:"id"`
	X  float32 `json:"x"`
	Y  float32 `json:"y"`
}

Position ...

func (*Position) Mask

func (a *Position) Mask() uint64

func (*Position) WithX added in v0.3.3

func (a *Position) WithX(x float32) *Position

func (*Position) WithY added in v0.3.3

func (a *Position) WithY(y float32) *Position

type Size

type Size struct {
	ID     string  `json:"id"`
	Height float32 `json:"height"`
	Width  float32 `json:"width"`
}

Size ...

func (*Size) Mask

func (a *Size) Mask() uint64

func (*Size) WithHeight added in v0.3.3

func (a *Size) WithHeight(height float32) *Size

func (*Size) WithWidth added in v0.3.3

func (a *Size) WithWidth(width float32) *Size

type Velocity

type Velocity struct {
	ID string  `json:"id"`
	X  float32 `json:"x"`
	Y  float32 `json:"y"`
}

Velocity ...

func (*Velocity) Mask

func (a *Velocity) Mask() uint64

func (*Velocity) WithX added in v0.3.3

func (a *Velocity) WithX(x float32) *Velocity

func (*Velocity) WithY added in v0.3.3

func (a *Velocity) WithY(y float32) *Velocity

Jump to

Keyboard shortcuts

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