my project is like crossword puzzle where i pin individual letters to large image that is empty crossword puzzle.
i have problem when i want to scale that large image... all my letters lose their pin spots...
how can i scale all my sprites like layout scaling does?
any solutions to this problem?
Develop games in your browser. Powerful, performant & highly capable.
woof... i recons you have a few ways to solve this.
ideally i need to know if your scaling the background image on the construct 2 screen (in which case you are left to move things individually
else, if you are scaling the background object in the game i need to know if the background is a single object
you could add loads of image points on the background (grid i assume) then assign a variable to the pin points, on start up event set position THEN pin to the required image point
or have an event that happens after the scaling is finished to reset letter positions to the image points
i think if i was doing what you are doing, i'd have lots of sprites as background tiles. 2 colours, so if you have blacked out squares nothing will pin.
if the image is white, it allows the clicking operation.
on click letter tile, set a global variable to show what letter is selected, then on click a white square, add the variable to the white's own variable
if white variable =1
white spawn sprite(A) image point 1 ect
i know this is more of how i would create the crossword than how to fix your problem. put pins are useless if not already in position, try an "anchor" guide also
hope this helps, if your looking for a code to work out the increase in size relative to the position.... there are easier ways to set positions
You could just scale the layer the crossword is on.
Yes, that was mine first bet... than i realised that it dont work as one would expect so i reported a bug...
(i am using not just scale of layer but also a canvas snapshot in combination with its own resizing...)
If you scale the crossword by a factor "scale" you could do this:
crosswordgrid: set size to (self.width*scale, self.height*scale)
letter: set x to (letter.x - puzzlegrid.x)*scale + puzzlegrid.x
letter: set y to (letter.y - puzzlegrid.y)*scale + puzzlegrid.y
R0J0 saves the day once again!!!