MCPcopy Index your code
hub / github.com/EngoEngine/engo / GetTile

Method GetTile

common/level.go:232–241  ·  view source on GitHub ↗

GetTile returns a *Tile at the given point (in space / render coordinates).

(pt engo.Point)

Source from the content-addressed store, hash-verified

230
231// GetTile returns a *Tile at the given point (in space / render coordinates).
232func (l *Level) GetTile(pt engo.Point) *Tile {
233 mp := l.mapPoint(pt)
234 x := int(math.Floor(mp.X))
235 y := int(math.Floor(mp.Y))
236 t, ok := l.pointMap[mapPoint{X: x, Y: y}]
237 if !ok {
238 return nil
239 }
240 return t
241}
242
243// Width returns the integer width of the level
244func (l *Level) Width() int {

Callers 3

TestTMXLevelFunction · 0.80
TestTMXLevelIsometricFunction · 0.80
UpdateMethod · 0.80

Calls 2

mapPointMethod · 0.95
FloorFunction · 0.92

Tested by 2

TestTMXLevelFunction · 0.64
TestTMXLevelIsometricFunction · 0.64