debug

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package debug helps with drawing debug information on the screen

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawRect

func DrawRect(screen *ebiten.Image, xOffset, yOffset float64, leftVec vec.MutableVector, width, height float64, outlineColor color.Color)

DrawRect draws a rectangle on the screen, with regards of an X and Y offset as a camera projection. At the given point, as well as width, height and color.

Types

type HitBoxDrawComponent

type HitBoxDrawComponent struct {
	// contains filtered or unexported fields
}

HitBoxDrawComponent is used to draw the hit box of a given entity

func NewHitBoxDrawComponent

func NewHitBoxDrawComponent(origin subjects.Originer, originAsCenter bool, width, height float64, opts ...HitBoxDrawOpt) *HitBoxDrawComponent

NewHitBoxDrawComponent creates a new HitBoxDrawComponent at origin, with given width and height and specifying if the origin is centered

func (*HitBoxDrawComponent) Draw

func (hb *HitBoxDrawComponent) Draw(screen *ebiten.Image, xOffset, yOffset float64)

Draw draws the hit box of the entity. X and Y offset are for a camera projection.

func (*HitBoxDrawComponent) SetColor added in v0.1.5

SetColor is the fluent api for setting the outline drawing color

func (*HitBoxDrawComponent) Update

func (hb *HitBoxDrawComponent) Update() error

Update as called via the main game loop. Unused at this point.

type HitBoxDrawOpt

type HitBoxDrawOpt func(hb *HitBoxDrawComponent)

HitBoxDrawOpt is used to configure the HitBoxDrawComponent

func HitBoxDrawColor

func HitBoxDrawColor(c color.Color) HitBoxDrawOpt

HitBoxDrawColor is HitBoxDrawOpt to change the color of the hit box outline.

type OriginDrawComponent

type OriginDrawComponent struct {
	// contains filtered or unexported fields
}

OriginDrawComponent draws a point at the entity origin

func NewOriginDrawComponent

func NewOriginDrawComponent(origin subjects.Originer, opts ...OriginOpt) *OriginDrawComponent

NewOriginDrawComponent creates a new OriginDrawComponent at origin with configuring options

func (*OriginDrawComponent) Draw

func (oc *OriginDrawComponent) Draw(screen *ebiten.Image, xOffset, yOffset float64)

Draw draws the point on the screen with the given X and Y offsets. These offsets are used for a camera projection.

func (*OriginDrawComponent) SetAntiAlias added in v0.1.5

func (oc *OriginDrawComponent) SetAntiAlias() *OriginDrawComponent

SetAntiAlias is the fluent api for setting the antialias property

func (*OriginDrawComponent) SetColor added in v0.1.5

SetColor is the fluent api for setting the color

func (*OriginDrawComponent) SetRadius added in v0.1.5

func (oc *OriginDrawComponent) SetRadius(radius float32) *OriginDrawComponent

SetRadius is the fluent api for setting the radius

func (*OriginDrawComponent) Update

func (oc *OriginDrawComponent) Update() error

Update to be called via the main game loop. Unused at this point.

type OriginOpt

type OriginOpt func(oc *OriginDrawComponent)

OriginOpt is used to configure the OriginDrawComponent

func SetAntiAlias

func SetAntiAlias() OriginOpt

SetAntiAlias is an OriginOpt for setting the anti aliasing nature of the point

func SetColor

func SetColor(c color.Color) OriginOpt

SetColor is an OriginOpt for setting the color of the point

func SetRadius

func SetRadius(radius float32) OriginOpt

SetRadius is an OriginOpt for setting the radius of the point

Jump to

Keyboard shortcuts

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