Scaling HUD for CocoonJS

Get help using Construct 2

Post » Thu Jan 31, 2013 10:10 am

Hi,

I'm trying for 3 days to avoid my HUD scaling.
In fact i want my HUD to stay the same whatever the screen resolution.

I did like the support multiple screen size tutorial says :
Layer with Scale and Parallax to 0 and anchoring

Unfortunately it doesn't work.

May be I forgot something, could you help me?

Thanks
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Thu Jan 31, 2013 10:34 am

@beufreecasse after giving your text object or HUD sprites the Anchor behavior did you set the Anchor properly?

For example if you give a text object an anchor behavior, and you want it to always stay in the upper left corner of the screen you need to tell the Anchor object to do that in the Object type properties window.

Here is an example:

https://dl.dropbox.com/u/43763487/examples/Full_Screen_Scale.capx

Just click on each sprite, and see the differences. Notice in the Object type properties window how I anchored each sprite on the main layer to a different edge of the window.
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Thu Jan 31, 2013 1:17 pm

Yes, i did the same thing and anchoring is working well, the point is that when the resolution is different than the Project WindowSize my HUD sprites zoom out.
How can i avoid this zoom out when scaling?
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Fri Feb 01, 2013 5:30 am

Try playing around with the Scale rate in the HUD's Layer properties window. Compare the differences between 0, and 100 maybe it could be a bug in C2.

Edit:

I just read your post title again "Scaling HUD for CocoonJS". If your using the text object this is a known issue with CocoonJS.

Here is the solution:

They way of using fonts in CocoonJS

And here is another issue:

http://www.scirra.com/forum/cocoonjs-fonts_topic57842_post378659.html?KW=fonts#378659

So what I do is unzip the exported file, delete the fonts folder, make a new fonts folder, put the ttf file inside, then zip it all back up, and then it works just fine.Wink2013-02-01 05:54:11
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Fri Feb 01, 2013 6:57 am

Thanks for your answer.
In fact it concerns normal sprites (pause button for exemple).
I tried to play with the scale rate, setting it to 100 and 0 but no differences.

I actually use Construct2 114 release.
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Fri Feb 01, 2013 7:14 am

it's the same thing with r117 :(
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Sun Feb 03, 2013 4:07 am

@beufreecasse could you try to recreate the problem with a simple .capx, and upload it here with dropbox?

I would really have to look at it because I'm just out of ideas.

If you can could you make it with v116 or earlier.Wink2013-02-03 04:47:09
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Sun Feb 03, 2013 8:53 am

@Wink yes thanks for your help :

https://dl.dropbox.com/u/107104215/test.capx
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Mon Feb 04, 2013 2:12 am

Here you go beufreecasse:

https://dl.dropbox.com/u/43763487/examples/unbound_scroll.capx

What I did was set Unbounded scroll to yes in your HUD's layers Layout properties window.

I really wasn't experiencing any issues with the sprite scrolling out on my devises when testing in landscape view.

Since your games Layout size is 960 W x 640 H you might want to lock your devices Cocoon Launcher app to Landscape when testing otherwise it will appear to zoom out but in reality it's not. It is just fitting the games window size to your devises screen size. I hope that made sense. lol

Anyway different game types, may require different settings for each layout when trying to support multiple screen resolutions in full screen scale. I wrote a little something about this here:

http://www.scirra.com/forum/multiscreen-cocoonjs_topic61313_post376578.html?KW=#376578

I hope this all helpsWink2013-02-04 02:29:21
B
50
S
11
G
8
Posts: 479
Reputation: 9,911


Return to How do I....?

Who is online

Users browsing this forum: Radulepy and 5 guests