I'm in some situations where I could make everything a lot better if I could somehow work with layers in my graphics.
I could give you an example. Let's say I want the player to only be able to see a few inches around his character (he is in a cave), and that the rest of the screen should be dark, with the exception of torches and other lighting stuff.
A super easy way to do this with more than one layer would be to draw the character and cave floor on layer 1, and then fill layer 2 completely black, and then "cut out" the areas of layer 2 that shouldn't be black, before you render layer 2 on top of layer 1.
(by the way, I'm not making a character in a cave-game, so don't provide better solution for that example. It's just that, an example)
Is it a viable option to have a screen sized pixmap? I'm guessing not, since pixmaps aren't very fast at drawing? Drawing the pixmap or converting it to a TImage every single frame sounds unrealistic, but I might I be wrong?
Or am I going about this completely wrong?
I could give you an example. Let's say I want the player to only be able to see a few inches around his character (he is in a cave), and that the rest of the screen should be dark, with the exception of torches and other lighting stuff.
A super easy way to do this with more than one layer would be to draw the character and cave floor on layer 1, and then fill layer 2 completely black, and then "cut out" the areas of layer 2 that shouldn't be black, before you render layer 2 on top of layer 1.
(by the way, I'm not making a character in a cave-game, so don't provide better solution for that example. It's just that, an example)
Is it a viable option to have a screen sized pixmap? I'm guessing not, since pixmaps aren't very fast at drawing? Drawing the pixmap or converting it to a TImage every single frame sounds unrealistic, but I might I be wrong?
Or am I going about this completely wrong?