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.
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.
Its did not work for me.
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?
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!!!
Develop games in your browser. Powerful, performant & highly capable.
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.
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