Last active
December 22, 2015 13:58
-
-
Save unagisyan/6482425 to your computer and use it in GitHub Desktop.
setGraphicAnimeSequenceで登録したアニメーションを同じアクターでもう一度再生したい。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 適当にカット | |
G.base = loadGraphic("res/img/base.png") | |
G.hoge_anime = {} | |
table.insert(G.hoge_anime, cutGraphic(G.base, 0, 0, 64, 64)) | |
table.insert(G.hoge_anime, cutGraphic(G.base, 0, 64, 64, 64)) | |
setGraphicAnimeSequence(G.hoge_anime, 2); | |
-- アクターに割り当て | |
local hoge_actor = createActor(G.hoge_anime, 100, 100, 0, 0, LAYER_HOGE) | |
-- 仮に10フレーム経過してアニメーションの再生が終わったと仮定する | |
wait(10) | |
-- ループではなく任意のタイミングで、もういちど同じアクターでアニメを再生したいときはMOVER_SETFACEを使えばできる | |
addMover(hoge_actor, -1, 1, MOVER_SETFACE, G.hoge_anime[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment