radar

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X, Y *float64
}

Point is a utility function for location

type Radar

type Radar struct {
	render.LayeredPoint
	// contains filtered or unexported fields
}

Radar helps store and present information around interesting entities on a radar map

func NewRadar

func NewRadar(w, h int, points map[Point]color.Color, center Point, ratio float64) *Radar

NewRadar creates a radar that will display at 0,0 with the given dimensions. The points given will be displayed on the radar relative to the center point, With the absolute distance reduced by the given ratio

func (*Radar) AddPoint

func (r *Radar) AddPoint(loc Point, c color.Color)

AddPoint adds an additional point to the radar to be tracked

func (*Radar) Draw

func (r *Radar) Draw(buff draw.Image)

Draw draws the radar, satisfying render.Renderable

func (*Radar) DrawOffset

func (r *Radar) DrawOffset(buff draw.Image, xOff, yOff float64)

DrawOffset draws the radar at a given offset

func (*Radar) GetRGBA

func (r *Radar) GetRGBA() *image.RGBA

GetRGBA returns this radar's image

func (*Radar) SetPos

func (r *Radar) SetPos(x, y float64)

SetPos sets the position of the radar on the screen

Jump to

Keyboard shortcuts

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