2.5D sprite scale

Get help using Construct 2

Post » Thu Jun 13, 2013 7:51 pm

I'm working on an adventure game where I want the character to scale to simulate a Z direction. I think this is doable with the screen Y coordinates, but since I plan to release it on different devices the resolution (and coordinates) will vary. Is there some way to replace the coordinates with an percentage?

Illustration:
B
34
S
15
G
6
Posts: 244
Reputation: 4,372

Post » Thu Jun 13, 2013 8:45 pm

Why not work in a fixed resolution (a work resolution so to say) and let the engine-side scaling do the rest?

rock on,
Michael
B
15
S
6
G
3
Posts: 23
Reputation: 2,733

Post » Thu Jun 13, 2013 8:58 pm

Whenever you want to turn a Y value (in pixels) into a percentage, you need to divide that value by the WindowHeight (maximum Y value) and then multiply by 100 (this gives a value between 0, 100 that represents percentage). Now if you want to work in percentages and then translate that into a Y value, just do the same thing going the other way. Percentage divided by 100 (this becomes a decimal between 0, 1) now multiply that by your WindowHeight, and you'll get your correct Y value (in pixels). Hope this helps/is useful for you :)
B
69
S
10
G
9
Posts: 299
Reputation: 8,935

Post » Fri Jun 14, 2013 6:07 pm

@Grave But won't this result in poor performance on mobile devices?

@brent_hamel Thanks! This sounds like the thing I was looking for:)
B
34
S
15
G
6
Posts: 244
Reputation: 4,372

Post » Fri Jun 14, 2013 7:08 pm

@dhondon When I think about it a little more you will have to do some scaling anyway, else you will not get to any fullscreen other than the resolution you designed. For example you do a 1024x768 project size for an ipad2, you will have to use scaling (either up or downscale) to get a fullscreen display when switching to devices that have a different native screen resolution (on an ipad3 it would be an upscale by 2).
If you decide to work on a project that supports ipad3 (2048x1536 resolution) you will most certainly get to a point where you have to reduce texture sizes and scale up your images.The ipad3 performs pretty poor with it's highres screen and high definition images eat up a lot of memory. For the sake of performance you should keep your working resolution as low as possible :)

rock on,
Michael
B
15
S
6
G
3
Posts: 23
Reputation: 2,733


Return to How do I....?

Who is online

Users browsing this forum: kototouchdown, lennaert, ThePakernator and 9 guests