-
Notifications
You must be signed in to change notification settings - Fork 1
/
axe.go
31 lines (28 loc) · 1005 Bytes
/
axe.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package ua
import (
"github.com/axe/axe-go/pkg/gfx"
"github.com/axe/axe-go/pkg/ui"
)
var (
// Explode
ExplodeGen = func(scale float32) ui.BasicAnimation {
return AnimationGen([]ui.BasicAnimationFrame{
{Time: 0, Transparency: 0, Scale: &gfx.Coord{X: 1, Y: 1}, Origin: OriginCenter},
{Time: 1, Transparency: 1, Scale: &gfx.Coord{X: scale, Y: scale}, Origin: OriginCenter},
})
}
Explode = ExplodeGen(4)
// Reveal
RevealGen = func(startX, startY float32, origin ui.AmountPoint) ui.BasicAnimation {
return AnimationGen([]ui.BasicAnimationFrame{
{Time: 0, Scale: &gfx.Coord{X: startX, Y: startY}, Origin: origin},
{Time: 1, Scale: &gfx.Coord{X: 1, Y: 1}, Origin: origin},
})
}
RevealDown = RevealGen(1, 0, OriginTop)
RevealUp = RevealGen(1, 0, OriginBottom)
RevealUpDown = RevealGen(1, 0, OriginCenter)
RevealLeft = RevealGen(0, 1, OriginCenterLeft)
RevealRight = RevealGen(0, 1, OriginCenterRight)
RevealLeftRight = RevealGen(0, 1, OriginCenter)
)