Skip to content

Instantly share code, notes, and snippets.

@RavensKrag
Last active December 13, 2015 19:48
Show Gist options
  • Save RavensKrag/4964979 to your computer and use it in GitHub Desktop.
Save RavensKrag/4964979 to your computer and use it in GitHub Desktop.
Animation interface
@animation["my_animation"].fade_in(5.frames) do |influence, time|
# influence = Current influence [0..1]
# time = milliseconds since the fade started [0..timeout]
# Result of this block becomes the influence for the next frame
# After the time specified, this track will be disabled
a = 1
b = 1
c = 1
Oni::Animation.ease_in_cubic(influence, time, a,b,c)
end
@animation["test"].weight = 1.0
@animation["test"].time = 0.0
@animation["test"].enabled = true
@animation["test"].rate = 1.0
@animation["test"].loop = true # loop is a method, not a real Ruby reserved word
@animation["test"].playing?
@animation["test"].enabled?
puts @animation["test"].weight
puts @animation["test"].rate
puts @animation["test"].length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment