Skip to content

Instantly share code, notes, and snippets.

@Majirefy
Created March 20, 2017 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Majirefy/6d379bbcdbd819abfbdf8f861772520a to your computer and use it in GitHub Desktop.
Save Majirefy/6d379bbcdbd819abfbdf8f861772520a to your computer and use it in GitHub Desktop.
private fun createAnimation(names: Array<String>): Animation {
val frames = com.badlogic.gdx.utils.Array<TextureRegion>()
frames.setSize(names.size)
for (i in names.indices) {
val path = names[i]
frames[i] = textureAtlas.findRegion(path)
}
return Animation(GameSettings.ANIMATION_FRAME_DURATION, frames)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment