mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-10 06:16:27 -05:00
21 lines
264 B
Go
21 lines
264 B
Go
package d2maprenderer
|
|
|
|
type Camera struct {
|
|
x float64
|
|
y float64
|
|
}
|
|
|
|
func (c *Camera) MoveTo(x, y float64) {
|
|
c.x = x
|
|
c.y = y
|
|
}
|
|
|
|
func (c *Camera) MoveBy(x, y float64) {
|
|
c.x += x
|
|
c.y += y
|
|
}
|
|
|
|
func (c *Camera) GetPosition() (float64, float64) {
|
|
return c.x, c.y
|
|
}
|