Welcome!
This is isotool. A tool for drawing textured isometric voxels!
how to make blocks/ how they work
sprites 1 to (however many blocks you want) are used as an index to a table called blks. This stores information on how to draw each block.
|
[80x16] |
|
[88x16] |
You make new blocks by making a new sprite, drawing the cube, and then making an entry in the blks table.
The easiest to plot is mirrored blocks, where only half of the pixel data is stored in the spreadsheet.
here's an example of a mirrored block in the blks table:
blks={
{s={66,66},sh={}}
} |
s is the top sprite number of the block. If you were to plot a full block, the second number would be different eg: s={73,74}
The table shown above is the same table as the dirt block that comes with this cart. And this is what it looks like in the sprite sheet:
|
|
[8x16] |
sh is the table you'll use if you want to hand pixel your own shadows for a block. In case the pal swap shading isn't to your liking.
Here's an example of a half block with custom shadows:
blks={
{s={64,64}sh={65,65}}
} |
|
[16x16] |
This renderer also supports transparency! (as well as some other shading customisation)
There are a few "flags" that can go along with the blks data. One being sith or see-through. The transparent color for this is 15. To enable this flag. simply add it to the specific block table as sith=1
The other two flags are noscst, and nosdw. aka "no casting" and "no shadow". No casting meaning it wont cast a shadow on other blocks. And no shadow meaning its faces wont be shaded no matter what.
all three of these are used in the glass block provided with this cart as i felt that glass being shaded and or casting shadows was odd!
glass table:
blks={
{s={71,71},sh={},sith=1,nocst=1,nosdw=1}
} |
drawing the map!
The main function you need to know about is isomap(). This function takes the perameters [w,d,h,sx,sy,ox,oy], where:
w,dandhare the block dimensions of the map you'd like to drawsx,syis the map origin for sampling block dataox,oyis the pixel offset for drawing the map to the screen
the 3D block data is laid out layer by layer in the pico-8 map, and can be edited using the pico-8 map editor
3d sprites!
Making pretty cube worlds is fun, but having something move around the screen is better.
other settings!
You can change the global shading direction by changing the variable lightdir. lightdir 1 shades the right face. and lightdir 0.
setting lightdir to anything other than 0 or 1 disables lighting, an effect similar to a fullbright mode
There's also nocast a bool to dissable/ enable casting globally
important notes!
the block data needs to fit on the pico-8 map: given d layers of dimensions w,h, w*d shouldn't exceed 128, and h shouldn't exceed 64/128, depending on your map/sprite shared ROM usage
Drawing this many sprites on screen is CPU intensive! Make sure to remove blocks that are unnecessary/ unseen
While nothing changes the renderer caches the last drawn frame to 0x8000..0x9fff
This is version 1.0.0 so there may be bugs that i havent caught/ optimisations i've overlooked!
I wouldn't recommend using this for big projects at the moment. It's not where i'd like it to be. And i hope by releasing it people can contribute and make this tool better for all!
[Please log in to post a comment]




