Question about power of 2

Get help using Construct 2

Post » Mon Feb 02, 2015 12:43 pm

I understand the whole power of 2 idea and how all your graphics should be a power of 2, to increase performance of your games, but there's something I'd like to know, regarding transparency.

I get that you need to use as little transparency as possible in your sprites and you can crop out any transparency around your sprites, but by cropping the transparency, it will change the sprite's size. Do your sprites only need to be imported at a power of 2 size, then you can scale them down to whatever size you want? Or do your sprites have to stay at a power of 2 size, even when cropping out transparency in engine?

Thanks for any advice anyone might have!
B
3
Posts: 14
Reputation: 203

Post » Mon Feb 02, 2015 1:00 pm

I believe the suggestion is to mostly stay within sensible sizes, i.e. don't make your art 513x513 pixels as then it will need a 1024x1024 texture. As you crop your images the system will find the best way to arrange them on a spritesheet while adding a single pixel of transparency on each side to avoid artifacts when scaling. So if your initial art is within a power of 2 minus 2px rectangle you should be just fine.
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

Post » Mon Feb 02, 2015 1:29 pm

For sprites you can more or less ignore the power of two thing, because they get spritesheeted on to a single larger image. Since they are assembled on to a power-of-two spritesheet with a 1px border, the optimal size is actually 2^n-2, e.g. 30, 62, 126, etc.
Scirra Founder
B
400
S
236
G
89
Posts: 24,546
Reputation: 195,471

Post » Mon Feb 02, 2015 3:32 pm

But you need to try to make them so that they will make the spritesheet power of 2.
Ashley should really emphasise the power of 2 -2
Image ImageImage
B
171
S
50
G
180
Posts: 8,396
Reputation: 113,986

Post » Mon Feb 02, 2015 3:36 pm

Thanks very much for the information. It's definitely cleared things up for me :) I'll take the power of 2 - 2 into consideration whilst designing the graphics.
B
3
Posts: 14
Reputation: 203


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests