mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-12 09:52:19 +08:00
Create TODO_Animation.md
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Animation (continuation)
|
||||
|
||||
### Goal
|
||||
- Implement Animation in GacUI XMl Resource
|
||||
- Possible to provide state machine XML tags
|
||||
|
||||
### Script
|
||||
|
||||
```
|
||||
|
||||
class MyProperties
|
||||
{
|
||||
prop A : int {}
|
||||
prop B : int {}
|
||||
}
|
||||
|
||||
func CreatePropA() : MyProperties^ { ... }
|
||||
...
|
||||
|
||||
func MyCalculation(dest: MyProperties^, a: MyProperties^, b: MyProperties^, ...): void { ... }
|
||||
|
||||
$interface IMyAnimation : IGuiAnimation<MyProperties>; // prop CurrentState : MyProperties^ {}
|
||||
|
||||
func MyAnimation() : IMyAnimation
|
||||
${
|
||||
$Set CreatePropA(); // or use CurrentState
|
||||
$Play CreatePropB(), 10 // gradually change to the specified state during 10 seconds
|
||||
$Play CreatePropC(), 10, [$1*$1] // change the default linear interpolation
|
||||
for(i in range [1, 10])
|
||||
{
|
||||
$Play CreatePropB(), 10, MyCalculation // call a function to decide the interpolation
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user