mirror of
https://github.com/stevenhowes/GoRetro.git
synced 2026-05-27 00:03:29 +01:00
Moveable viewport. Absolute positioning (for UI etc) is possible. Added distance-based bounder for projectiles etc as 'screen' is no longer a suitable bounder. Removed debug msg.
This commit is contained in:
@@ -46,11 +46,16 @@ func (sr *spriteRenderer) onUpdate() error {
|
||||
}
|
||||
|
||||
func (sr *spriteRenderer) onDraw() error {
|
||||
Position := sr.container.Position
|
||||
if !sr.container.PositionAbsolute {
|
||||
Position = vectorAdd(sr.container.Position, ViewPort.Position)
|
||||
}
|
||||
|
||||
return drawTexture(
|
||||
sr.tex,
|
||||
VectorInt32{-1, -1},
|
||||
VectorInt32{0, 0},
|
||||
sr.container.Position,
|
||||
Position,
|
||||
sr.container.Rotation,
|
||||
sr.container.Renderer)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user