Hi,
I'm trying to have a semi transparent sprite (colorkey).
This is my loading code:
Set Image Colorkey 229, 190, 255
tempNum = 0
For x = 0 to int((tTileSetImageWidth / tileWidth) * ((tTilesetImageHeight / tileHeight) - 1))
Cls
Print x
Array Insert At Bottom Gids()
tIndex = Array Count(Gids())
Gids(tIndex).ImgID = Find Free Image()
Load Image "Data/gfx/tiles/" + Str$(tIndex) + ".png", Gids(tIndex).ImgID
Next X
Cls
Print Array Count(Gids())
Print "Layers: ", Array Count(Layer())
// Wait key
// Open Console
// Draw actual map
Sync on
Sync rate 60
Draw sprites first
Do
Set cursor 0, 0
tempGid = 0
TimerBegin = Timer()
For tempLayer = 1 to Array Count(Layer())
For Y = 0 to tMapHeight - 1
For X = 0 to tMapWidth - 1
inc tempGid
If Tile(TempGid).AssignedLayer = tempLayer
If Gids(Tile(tempGid).gid).ImgID <> 0
Sprite Tile(tempGid).SprID, X * tileWidth, Y * tileHeight, Gids(Tile(tempGid).gid).ImgID
Set Sprite Tile(tempGid).SprID, 1, 1
//Set Sprite Alpha Tile(tempGid).SprID, 200
Endif
Endif
Next X
Next Y
Next tempLayer
`Print "took: ", Timer() - TimerBegin
Print "FPS: ", Screen FPS()
Sync
Loop
As some of you can see, this is for a tileset.
My sprites come out fully solid. Checked the colorkey twice. Why?
Thanks!
Jeff
PS. If someone sees an inefficient part in my code, tell me 'bout it!