mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-06-20 06:05:23 +00:00
cof: added Duration method
This commit is contained in:
parent
e7c5efe8e4
commit
78404ed56c
|
@ -14,3 +14,14 @@ func (c *COF) SpeedToFPS() float64 {
|
||||||
|
|
||||||
return fps
|
return fps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Duration returns animation's duration
|
||||||
|
func (c *COF) Duration() float64 {
|
||||||
|
const (
|
||||||
|
milliseconds = 1000
|
||||||
|
)
|
||||||
|
|
||||||
|
frameDelay := milliseconds / c.SpeedToFPS()
|
||||||
|
|
||||||
|
return float64(c.FramesPerDirection) * frameDelay
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user