Created
April 11, 2022 00:00
-
-
Save dacap/7d954e6396c450f3a8a6cfbc584b1726 to your computer and use it in GitHub Desktop.
Assign a key to play a tag named "TagName"
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
local spr = app.activeSprite | |
if not spr then return end | |
for _,t in ipairs(spr.tags) do | |
if t.name == "TagName" then | |
local old_play_once = app.preferences.editor.play_once | |
local old_play_all = app.preferences.editor.play_all | |
app.activeFrame = t.fromFrame | |
app.preferences.editor.play_once = true | |
app.preferences.editor.play_all = false | |
app.command.PlayAnimation() | |
app.preferences.editor.play_once = old_play_once | |
app.preferences.editor.play_all = old_play_all | |
break | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment