[orx-keyframer] Add envelopes, remove repetitions
This commit is contained in:
@@ -8,10 +8,9 @@ fun main() = application {
|
||||
program {
|
||||
class Animation: Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
val radius by DoubleChannel("x")
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-repetitions-01.json")))
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-envelope-01.json")))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
@@ -19,7 +18,7 @@ fun main() = application {
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, animation.radius)
|
||||
drawer.circle(animation.position, 100.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
25
orx-keyframer/src/demo/resources/demo-envelope-01.json
Normal file
25
orx-keyframer/src/demo/resources/demo-envelope-01.json
Normal file
@@ -0,0 +1,25 @@
|
||||
[
|
||||
{
|
||||
"time": 0.0,
|
||||
"x": 320.0,
|
||||
"y": 240.0
|
||||
},
|
||||
{
|
||||
"time": 10.0,
|
||||
"easing": "cubic-in-out",
|
||||
"x": {
|
||||
"envelope": [0.5, 1.0],
|
||||
"value": 0.0
|
||||
},
|
||||
"y": {
|
||||
"envelope": [0.4, 1.0],
|
||||
"value": 0.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"time": 20.0,
|
||||
"x": 640.0,
|
||||
"y": 480.0,
|
||||
"easing": "cubic-in-out"
|
||||
}
|
||||
]
|
||||
@@ -1,30 +0,0 @@
|
||||
[
|
||||
{
|
||||
"time": 0.0,
|
||||
"x": 320.0,
|
||||
"y": 240.0,
|
||||
"radius": 0.0
|
||||
},
|
||||
{
|
||||
"time": 3.0,
|
||||
"repeat": {
|
||||
"count": 5,
|
||||
"keys": [
|
||||
{
|
||||
"duration": 1.0,
|
||||
"easing": "cubic-in-out",
|
||||
"x": 10.0,
|
||||
"y": 4.0,
|
||||
"radius": 400
|
||||
},
|
||||
{
|
||||
"duration": 1.0,
|
||||
"easing": "cubic-in-out",
|
||||
"x": 630.0,
|
||||
"y": 470.0,
|
||||
"radius": 40
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user