screenPoint returns the screen point of the passed in map point
(mapPt engo.Point)
| 211 | |
| 212 | // screenPoint returns the screen point of the passed in map point |
| 213 | func (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 | |
| 227 | type mapPoint struct { |
| 228 | X, Y int |
no test coverage detected