hit

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

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

Area encapsulates a hit testing region.

func NewArea

func NewArea(min, max Point) *Area

func (*Area) Add

func (a *Area) Add(min, max Point, obj TestableObj)

Add inserts the given object into the hit testing area.

func (*Area) Delete added in v0.3.0

func (a *Area) Delete(obj TestableObj)

Delete removes an object from the hit testing arena.

func (*Area) Test

func (a *Area) Test(p Point) TestableObj

Test computes the topmost object which intersects the given point.

type Point

type Point struct {
	X, Y float64
}

func (Point) Sub

func (p Point) Sub(in Point) Point

type TestableObj

type TestableObj interface {
	HitTest(Point) bool
}

Jump to

Keyboard shortcuts

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