I have a background image that is 2048x2048. These are stars on a transparent background. I want to create a sort of boundary, like some free roaming games have - if you start to get close to the boundary you receive a - "turn back or die" warning.
If i create this boundary as 1792x1600 but on a 2048x2048 canvas, will C2 and ultimately the processor of the desktop/mobile phone render it as 2048x2 or will it render as 1792x1600?
Thinking about performance issues here. I know a power of 2 will render better/quicker than a non-power of 2. This is just for the background images not the sprites themselves.
But thinking about sprites, would a 59x31px sprite render as 64x64? Or does it really matter with sprites?
Thanks for any input.
Develop games in your browser. Powerful, performant & highly capable.
Power of two generally doesn't have anything to do with rendering/processing performace, but how much video memory it takes up when loaded, as well as for overall project download size because of spritesheeting.
I'm no expert though, and I can't seem to find the documentation I recall reading about this previously. Maybe it was a forum post. Someone else may be answer with more detail, but the general advice will be don't worry about it, and you should avoid large images as much as possible and use tiled backgrounds instead to manage video memory efficiently.
Remember not to waste your memory
I don't know why a boundary image would need to be so large - if you're drawing all four edges with a large area of transparency in the middle, that is very wasteful. Just make each edge a separate sprite and place them around the edges. That means you don't need any transparent central area at all, which saves loads of memory.