I have 2 layers one is my "HUD" which has a sprite entire game size with a transparent "window" cut out, second layer has a tiled background 100 times the size of the game layout.
trying to get where I can drag the tiled background around but constrain it to the "window" of the sprite HUD.
I tried the drag&drop 2 with boundary plugins but then it makes it so I can't drag the background past the sides at all
thanks for any help
never mind I figured it out had to set the boundary left right top and bottom based on the layout co-ords and not my HUD sprite took some math to figure out the x and y for each but it works
Develop games in your browser. Powerful, performant & highly capable.
Any chance you can share a sample CAPX of the behavior you have come up with? I am very interested in the method used. Or maybe just a screenshot of the event sheet.
there are no events involved just rex's boundary behavior applied to the tiled background.
basically its all math so what I had to do was add a tiled background mine is 89000 x 52000 (i know its huge but its for a 800x800 map grid and each grid is 110x65 pixels) and add the boundary behavior.
find the pixel point of the top and bottom of the window
mine was 33 and 539
the 33 is the bottom. add them together (572) subtract that from the background height (51428) enter that as a negative number for top (-51428)
find the pixel point of the left and right of the window
mine was 22 and 866
the 22 is the right. add them together (888) subtract that from the background width (88112) enter that as a negative number for left (-88112)
enter the numbers into the top, bottom, left and right properties for the boundary behavior on the tiled background.