()
| 217 | } |
| 218 | |
| 219 | func (mouse *Mouse) RawWorldPosition() Vector { |
| 220 | |
| 221 | width, height, err := globals.Renderer.CurrentOutputSize() |
| 222 | |
| 223 | if err != nil { |
| 224 | panic(err) |
| 225 | } |
| 226 | |
| 227 | wx := mouse.screenPosition.X/float32(width) - 0.5 |
| 228 | wy := mouse.screenPosition.Y/float32(height) - 0.5 |
| 229 | |
| 230 | viewArea := globals.Project.Camera.ViewArea() |
| 231 | |
| 232 | wx *= float32(viewArea.W) |
| 233 | wy *= float32(viewArea.H) |
| 234 | |
| 235 | wx += globals.Project.Camera.Position.X |
| 236 | wy += globals.Project.Camera.Position.Y |
| 237 | |
| 238 | // Debug view |
| 239 | // globals.Renderer.SetDrawColor(255, 0, 0, 255) |
| 240 | // globals.Renderer.DrawRectF(globals.Project.Camera.Translate(&sdl.FRect{wx, wy, 16, 16})) |
| 241 | |
| 242 | return Vector{wx, wy} |
| 243 | |
| 244 | } |
| 245 | |
| 246 | func (mouse *Mouse) WorldPosition() Vector { |
| 247 |
no test coverage detected