debugtools

package
v3.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package debugtools provides structures to aid in development debugging of graphical programs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugMouseRelease

func DebugMouseRelease(ctx *scene.Context, k string)

DebugMouseRelease will print the position and button pressed of the mouse when the mouse is released, if the given key is held down at the time. If no key is given, it will always be printed

func EnumerateDebugRenderableKeys

func EnumerateDebugRenderableKeys() []string

EnumerateDebugRenderableKeys lists all registered renderables by key. It does not check to see if the associated renderables are still valid in any respect.

func GetDebugRenderable

func GetDebugRenderable(rName string) (render.Renderable, bool)

GetDebugRenderable returns whatever renderable is stored under the input string, if any.

func SetDebugRenderable

func SetDebugRenderable(rName string, r render.Renderable)

SetDebugRenderable stores a renderable under a name in a package global map. this is used by some built in debugConsole helper functions.

Types

type Rtree

type Rtree struct {
	*collision.Tree
	Thickness int
	render.LayeredPoint
	OutlineColor color.RGBA
	ColorMap     map[collision.Label]color.RGBA
	DrawDisabled bool
	Context      *scene.Context
}

An Rtree wraps around a collision tree and can draw debug rectangles for every entity in the tree.

func NewRTree

func NewRTree(ctx *scene.Context, t *collision.Tree) *Rtree

NewRTree creates a wrapper around a tree that supports coloring the spaces

func NewThickColoredRTree

func NewThickColoredRTree(ctx *scene.Context, t *collision.Tree, thickness int, colorMapping map[collision.Label]color.RGBA) *Rtree

NewThickColoredRTree creates a wrapper around tree that colors spaces up to a thickness based on a coloring map

func NewThickRTree

func NewThickRTree(ctx *scene.Context, t *collision.Tree, thickness int) *Rtree

NewThickRTree creates a wrapper around tree that colors spaces up to a thickness

func (*Rtree) Draw

func (r *Rtree) Draw(buff draw.Image, xOff, yOff float64)

Draw will draw the collision outlines

func (*Rtree) GetDims

func (r *Rtree) GetDims() (int, int)

GetDims returns the total possible area to draw this on.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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