08-28-2019, 03:15 AM
Hi again!
You can -in fact you must- draw something to the bitmap you're using in order to see anything. Just setting pixels or color entries won't give any result, you must set both. Be aware that a pixel value of 0 means fully transparent.
You don't have to use tilesets: bitmap layers and tiled layers are totally independent, which one to use depends on your game needs.
In your example, your call to TLN_SetLayerPalette(0, palette); is redundant: as you've already attached the palette to the bitmap with TLN_SetBitmapPalette(), calling TLN_SetLayerBitmap() automatically sets the palette too. You can set bitmap pixels and/or palette colors at any time, the effect will be visible on the next call to TLN_DrawFrame().
Keep going!
You can -in fact you must- draw something to the bitmap you're using in order to see anything. Just setting pixels or color entries won't give any result, you must set both. Be aware that a pixel value of 0 means fully transparent.
You don't have to use tilesets: bitmap layers and tiled layers are totally independent, which one to use depends on your game needs.
In your example, your call to TLN_SetLayerPalette(0, palette); is redundant: as you've already attached the palette to the bitmap with TLN_SetBitmapPalette(), calling TLN_SetLayerBitmap() automatically sets the palette too. You can set bitmap pixels and/or palette colors at any time, the effect will be visible on the next call to TLN_DrawFrame().
Keep going!