Log In  
Follow
Txori

Making games at www.txori.com

Draw SVG
by

Hello everyone. Today I wrote a script to swap Sprites positions without messing with the Map. Very handy to reorganise your sprite sheet. And Flags will follow. Here's how it works:

1- Make a backup

First thing first: make a backup of your p8 file!
This is important, as you can screw things up real quick if you do not pay attention.

2- Get the script

Create an empty file named "swapspr.lua" that you'll put alongside your p8 file.
Copy/paste this script to "swapspr.lua" and save it:

function swapspr(n1,n2)
	for i=0,7 do
		local p1=i*64+n1*4+448*flr(n1/16)
		local p2=i*64+n2*4+448*flr(n2/16)
		local b1,b2=peek4(p1),peek4(p2)
		poke4(p2,b1)
		poke4(p1,b2)
	end
	local f1,f2=fget(n1),fget(n2)
	fset(n1,f2)
	fset(n2,f1)
	for x=0,127 do
		for y=0,127 do
			if mget(x,y)==n1 then
				mset(x,y,n2)
			elseif mget(x,y)==n2 then
			 mset(x,y,n1)
			end
		end		
	end	
	cstore(0x0000,0x0000,0x7fff)

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=64987#p)
3
1 comment



Cart #wozupuruze-0 | 2019-06-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
21

Draw SVG

This is a tool do display vectorial drawings in PICO-8. It's useful for logos and big curved shapes that can't fit in memory as regular sprites. Also, you can zoom on those drawings at will.

CONTROLS:

Arrows: move around
Z/X: zoom in/out

HOW TO CONVERT SVG FILES TO PICO-8:

Simply use converter tool at:
http://www.txori.com/index.php?static14/pico8
The first number of each vector is the color of that vector.

RELEASE HISTORY:

[hidden]

v1.1
SVG draw engine entirely rewritten
30fps!

v1.0
Initial release

[ Continue Reading.. ]

21
5 comments