Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Useful sprite draw function for PICO-8 (and maybe Lua in general)
--
-- draws a sprite to the screen with an outline of the specified colour
--
function outline_sprite(n,col_outline,x,y,w,h,flip_x,flip_y)
-- reset palette to black
for c=1,15 do
pal(c,col_outline)
end
-- draw outline
for xx=-1,1 do
for yy=-1,1 do
spr(n,x+xx,y+yy,w,h,flip_x,flip_y)
end
end
-- reset palette
pal()
-- draw final sprite
spr(n,x,y,w,h,flip_x,flip_y)
end
@cpgb85

This comment has been minimized.

Copy link

cpgb85 commented Mar 10, 2020

Great simple script!

@Lambdanaut

This comment has been minimized.

Copy link

Lambdanaut commented May 16, 2020

Awesome! Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.