How do I stretch to fullscreen and rearrange controls (web).

Get help using Construct 2

Post » Wed Apr 15, 2015 12:03 pm

I finally got to stretch the image to full screen With the help of the people on this forum.
Now I have a new problem :-(

I created a new family and added there all the objects that I need. the family name is "FallButtons"
After Stretching the picture to full screen i add code to change location and size of all "FallButtons" controls, It works great But If I run it on a computer with a different resolution The arrangement of the controls are not working well.

my resolution 1366X768 It works great.
All other resolutions are not working well.

my Code

Image
B
13
S
2
Posts: 95
Reputation: 861

Post » Wed Apr 15, 2015 12:08 pm

You shouldn't need that code for this.
Adding the anchor-behaviour and putting the buttons on a layer with no parallax should do the trick.

By the way,
The reason I used viewportright(0)-viewportleft(0) was to make sure that when you use something like scrollto to get something to center it doesn't mess up the width,
for even if the coordinates of viewportleft were to be negative the width would still be correct.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Apr 15, 2015 1:20 pm

Its did not work for me.
B
13
S
2
Posts: 95
Reputation: 861

Post » Wed Apr 15, 2015 1:46 pm

What did not work and what is it doing that you didn't expect?

It might be easier to explain what to do, if you gave more information on what you are trying to achieve.
Also saying something doesn't work without giving any explanation on what you have tried and what effect that has or hasn't had, is not very constructive.
Where do you want the buttons to be in the game?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Apr 15, 2015 2:26 pm

Sorry i answered through my cell phone and it was hard for me to write.

I have buttons on my stretched picture and on the picture has buttons in specific locations. After I change the size of the picture because the resolution or change the size of the browser the buttons need to adjust to the new screen size (Location and Size).

I did what you said and the buttons remain in place.

Thanks for everything!!!
B
13
S
2
Posts: 95
Reputation: 861

Post » Thu Apr 16, 2015 10:19 am

I really would love to get help on this issue. Please I work hours and can not manage to do it. I really would love to get an example. I'm willing to pay for it.
B
13
S
2
Posts: 95
Reputation: 861

Post » Thu Apr 16, 2015 10:43 am

The question is really not that clear.
All I can do is shoot and hope to hit something, for I don't know what you are reaaly asking.

Would pinning the buttons to the sprite work?
If you'd like to resize the buttons the same way as the sprite it would mean calculating the size of the sprite compared to it's original and multiplying your button with that amount.

so first you would need the sprite's original size.
setting instance variables for originalwidth and origanalheight before changing it's size would do that.

to change the button it would look something like this

button set width - width= (sprite.width/sprite.originalwidth)*button.width
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests