[quote:3qxdgnrk]How the hell do you get proper alpha right off the bat with these things?
Convert the color mode of the PNG from Indexed to RGB. Then the transparency is preserved when the image is imported.
[quote:3qxdgnrk]Now, the next main problem to make this viable is Z-Order. In other words, layers. Oh, yeah, and collision, I forgot. You either want some things to collide, or some things to not collide, basically...
Z-Ordering is easy, just load each layer to a different layer.
For collisions just set the collision mode for all the sprites on one layer to per-pixel and none on the other layers.
Give the Sprite the Solid attribute and set it's collision mode to none.
Here's a updated script:
from xml.dom import minidom
mapfile = minidom.parse(System.AppPath + 'ConstructTestMap.tmx')
a = mapfile.getElementsByTagName('map')[0]
width = int(a.attributes['width'].value)
height = int(a.attributes['height'].value)
tilewidth = int(a.attributes['tilewidth'].value)
tileheight = int(a.attributes['tileheight'].value)
#load all layers
layernum=1
for layer in mapfile.getElementsByTagName('layer'):
index=0
for tile in layer.getElementsByTagName('tile'):
val = int(tile.attributes['gid'].value)
if val > 0:
System.Create('Sprite',layernum,0,0)
if layernum==2:
SOL.Sprite.SetCollisionMode(3) # 3 is per-pixel
SOL.Sprite.x=(index % width) * tilewidth
SOL.Sprite.y=(index / width) * tileheight
SOL.Sprite.SetAnimFrame(val)
index+=1
layernum+=1[/code:3qxdgnrk]