MCPcopy Create free account
hub / github.com/EngoEngine/engo / screenPoint

Method screenPoint

common/level.go:213–225  ·  view source on GitHub ↗

screenPoint returns the screen point of the passed in map point

(mapPt engo.Point)

Source from the content-addressed store, hash-verified

211
212// screenPoint returns the screen point of the passed in map point
213func (l *Level) screenPoint(mapPt engo.Point) engo.Point {
214 switch l.Orientation {
215 case orth:
216 mapPt.Multiply(engo.Point{X: float32(l.TileWidth), Y: float32(l.TileHeight)})
217 return mapPt
218 case iso:
219 return engo.Point{
220 X: (mapPt.X - mapPt.Y) * float32(l.TileWidth) / 2,
221 Y: (mapPt.X + mapPt.Y) * float32(l.TileHeight) / 2,
222 }
223 }
224 return engo.Point{X: 0, Y: 0}
225}
226
227type mapPoint struct {
228 X, Y int

Callers 2

BoundsMethod · 0.95
unpackTilesMethod · 0.95

Calls 1

MultiplyMethod · 0.45

Tested by

no test coverage detected