mirror of
https://github.com/stevenhowes/GoRetro.git
synced 2026-05-26 15:53:31 +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:
@@ -9,7 +9,6 @@ package GoRetro
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -65,12 +64,16 @@ func (an *animator) onUpdate() error {
|
||||
}
|
||||
|
||||
func (an *animator) onDraw() error {
|
||||
Position := an.container.Position
|
||||
if !an.container.PositionAbsolute {
|
||||
Position = vectorAdd(an.container.Position, ViewPort.Position)
|
||||
}
|
||||
|
||||
return drawTexture(
|
||||
an.tex,
|
||||
VectorInt32{an.sequences[an.current].frames[an.sequences[an.current].frame].W, an.sequences[an.current].frames[an.sequences[an.current].frame].H},
|
||||
VectorInt32{an.sequences[an.current].frames[an.sequences[an.current].frame].X, an.sequences[an.current].frames[an.sequences[an.current].frame].Y},
|
||||
an.container.Position,
|
||||
Position,
|
||||
an.container.Rotation,
|
||||
an.container.Renderer)
|
||||
}
|
||||
@@ -131,8 +134,6 @@ func NewSequence(
|
||||
}
|
||||
defer jsonFile.Close()
|
||||
|
||||
fmt.Println(seq.frames)
|
||||
|
||||
seq.frame = 0
|
||||
seq.sampleRate = sampleRate
|
||||
seq.loop = loop
|
||||
|
||||
Reference in New Issue
Block a user