Question about power of 2 and non-power of 2

Get help using Construct 2

Post » Sun Aug 14, 2016 7:12 pm

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.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Sun Aug 14, 2016 7:32 pm

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.
Mistakes were made.
B
52
S
26
G
111
Posts: 1,630
Reputation: 62,681

Post » Mon Aug 15, 2016 10:35 am

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.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,681


Return to How do I....?

Who is online

Users browsing this forum: mekonbekon and 25 guests