Quick Technical Sprite question

Discussion and feedback on Construct 2

Post » Wed Jul 03, 2013 11:26 pm

I understand that Construct 2 will automatically attempt to consolidate all the Sprites to 512x512 Spritesheets.

But say that you have a Sprite that is--for whatever reason--1 pixel wide by 1024 pixels tall. I assume that Construct 2 does not attempt to split this image up. If it did, it could theoretically be packaged into a 32x32 square, but I doubt that's what Construct 2 does.

So, what does happen? Does it instead create a single 1024x1024 Spritesheet, attempting to put the other Sprites in it as well? Or gasp, does it create a 1024x1024 Spritesheet exclusively for that object?

In this situation, it would make sense to break the Sprite into two Sprite objects, one lower one pinned to the top one, but that seems a bit excessive.

Any ideas?
B
11
S
2
Posts: 54
Reputation: 805

Post » Wed Jul 03, 2013 11:36 pm

creating a 1x1024 sprite sounds highly inneficient. A simple 32x32 sprite with a gradient could achieve the same result,
faster and cheaper on the CPU.
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Wed Jul 03, 2013 11:43 pm

@California

Yes, the 32x32 sprite sounds like it'd be faster, but a single 32x32 Sprite can't do everything a 1x1024 Sprite can. For instance, if you wanted to have a gradient that vertically spans the entire color wheel with 1024 different hues.
B
11
S
2
Posts: 54
Reputation: 805

Post » Wed Jul 03, 2013 11:48 pm

I'm curious about this too.
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Thu Jul 04, 2013 1:50 am

Well, you could test it with an export and see what happens...

Just did and it makes a 1x1024 file.
B
88
S
30
G
89
Posts: 5,113
Reputation: 60,337

Post » Thu Jul 04, 2013 2:00 am

You'll get a 1x1024 file, which some GPUs (including most mobile ones) will place in memory on a 1024x1024 surface because they can only deal with square power-of-two sized images. For this reason, you should avoid this type of thing if possible.
Scirra Founder
B
382
S
223
G
86
Posts: 23,997
Reputation: 189,771

Post » Thu Jul 04, 2013 2:15 am

[QUOTE=CannedEssence]a gradient that vertically spans the entire color wheel with 1024 different hues.[/QUOTE] sounds like you are designing a very colorful game

Honestly, I still don't know why would you want a 1024h sprite.

BTW, try using 9-patch.
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Thu Jul 04, 2013 2:31 am

Thank you for the responses, that's nice to know.

So you're saying that because of the graphics chip and VRAM on some devices, it might be faster to break the 1x1024 image down into a 32x32 image, where the gradient is arranged in a tabular way, i.e. to have the first 32 pixels from the top of the gradient as the first row, and so on; to then make the Sprite object, add the art as a spritestrip with 32 rows and columns;
to then generate 1024 instances of this object, placing each next frame below the previous.

Am I right?
B
11
S
2
Posts: 54
Reputation: 805


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests