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
#!/bin/sh | |
ext=$1 | |
for f in $(find . -name "*@4x.$ext"); do | |
echo "Converting $f..." | |
convert "$f" -resize '50%' -unsharp 1x4 "$(dirname $f)/$(basename -s "@4x.$ext" $f)@2x.$ext" | |
done | |
for f in $(find . -name "*@2x.$ext"); do | |
echo "Converting $f..." | |
convert "$f" -resize '50%' -unsharp 1x4 "$(dirname $f)/$(basename -s "@2x.$ext" $f).$ext" | |
done |
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 _M = {} | |
function _M.nextFrame(f) | |
timer.performWithDelay(1, f) | |
end | |
function _M.enterFrame() | |
for i = 1, #_M.enterFrameFunctions do | |
_M.enterFrameFunctions[i][1]() | |
end | |
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
local h, w = display.pixelWidth, display.pixelHeight | |
if (w == 1024 and h == 768) or (w == 960 and h == 640) or (w == 1136 and h == 640) or (w == 2048 and h == 1536) or (w == 1280 and h == 720) or (w == 480 and h == 320) then | |
while w > 700 do | |
w = w * 0.5 | |
h = h * 0.5 | |
end | |
w, h = h, w | |
else | |
w = 320 -- w = 300 -- for kindle fire and nexus 7 like tablets (1024x600) | |
h = 480 |
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 _M = {} | |
_M.deviceID = system.getInfo('deviceID') | |
if system.getInfo('environment') ~= 'simulator' then | |
io.output():setvbuf('no') | |
else | |
_M.isSimulator = true | |
end | |
local platform = system.getInfo('platformName') |
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
#!/bin/bash | |
rm _*.png | |
s=${1:-32} | |
ss=$((s+2)) | |
for f in $(find . -name "*@2x.png" -maxdepth 1); do | |
echo "Paddding $f..." | |
wo=`convert $f -ping -format "%w" info:` | |
h=`convert $f -ping -format "%h" info:` | |
w=$((wo + (wo / s)*2)) | |
convert $f \ |
NewerOlder