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
if app.preferences.experimental.nonactive_layers_opacity == 255 then | |
app.preferences.experimental.nonactive_layers_opacity = 128 | |
else | |
app.preferences.experimental.nonactive_layers_opacity = 255 | |
end |
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
/*** MIT LICENSE | |
Copyright (c) 2022 torcado | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following |
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 s = app.activeSprite | |
if not s then return end | |
local f = app.activeFrame | |
local readjustTags = {} | |
for _,t in ipairs(s.tags) do | |
if t.fromFrame.frameNumber == f.frameNumber and | |
t.toFrame.frameNumber == f.frameNumber then | |
table.insert(readjustTags, t) |
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 filenames = { | |
"/Users/david/piano00.png", | |
"/Users/david/drums00.png", | |
"/Users/david/bass00.png" | |
} | |
local spr = app.activeSprite | |
if not spr then return app.alert "No active sprite" end | |
for _,fn in ipairs(filenames) do |
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 app.alert "You need to create a sprite first" | |
end | |
app.transaction( | |
function() | |
app.command.NewLayer{ name="Tilemap", tilemap=true } | |
local grid = spr.gridBounds | |
for y=grid.y,spr.height,grid.width do | |
for x=grid.x,spr.width,grid.width do |
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 |
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 | |
local r = app.range | |
app.transaction( | |
function() | |
local oldActiveLayer = app.activeLayer | |
local oldActiveFrame = app.activeFrame | |
local deltaFrames = 0 |
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 | |
app.transaction( | |
function() | |
local oldActiveLayer = app.activeLayer | |
local oldActiveFrame = app.activeFrame | |
local deltaFrames = 0 | |
for i = #spr.frames,1,-1 do | |
local frame = spr.frames[i] |
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 | |
local tag = app.activeTag | |
local fr = app.activeFrame | |
if not spr or not tag then return end | |
local relativeFr = fr.frameNumber - tag.fromFrame.frameNumber | |
local function clamp(x, min, max) | |
if x < min then | |
return min |
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
{ "frames": [ | |
{ | |
"filename": "file 0.ase", | |
"frame": { "x": 0, "y": 0, "w": 32, "h": 32 }, | |
"rotated": false, | |
"trimmed": false, | |
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 }, | |
"sourceSize": { "w": 32, "h": 32 }, | |
"duration": 100 | |
}, |