MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Offset

Method Offset

camera.go:82–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80}
81
82func (camera *Camera) Offset() Vector {
83
84 width := globals.ScreenSize.X / 2 / camera.Zoom
85 height := globals.ScreenSize.Y / 2 / camera.Zoom
86
87 // Rounded makes movement more stuttery, but also removes subpixel wobbling a bit, sigh, can't have everything
88 point := Vector{(camera.Position.X - width), (camera.Position.Y - height)}.Rounded()
89 return point
90
91}
92
93func (camera *Camera) TranslateRect(rect *sdl.FRect) *sdl.FRect {
94

Callers 2

TranslatePointMethod · 0.95
UntranslatePointMethod · 0.95

Calls 1

RoundedMethod · 0.80

Tested by

no test coverage detected