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?
Develop games in your browser. Powerful, performant & highly capable.
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:
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.
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?
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.
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:
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.
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.
it's the same thing with r117 :(
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.
Wink yes thanks for your help :
Here you go beufreecasse:
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:
I hope this all helps