Button location

How can i locate a button in a specific location on a picture and make it invisible?
I have a picture of farm with animals and i want a button on each animal that will do voice when pressed.

Use canvas for the picture and imageSprites for the "buttons". Make yourself a transparent png image.

1 Like

For the Canvas approach, you could also keep a list of relative coordinates and radii, associated with animal locations.

When the Canvas is touched, run down the list and check touch (x,y) against each animal bounds.

P.S. This sounds like Mole Mash.

What do you mean by: "Make yourself a transparent image"?

Let me save you the trouble:


transparent.png.zip.txt (226 Bytes)
(remove the .txt to get the zip file, then extract the image inside)

Use this with your imageSprites to overlay the canvas image

...if your App is going to be distributed, consider setting the image as the background of a Vertical Arrangement. The image buttons can be in Arrangements too, with everything positioned in % - which should work across various phone and tablet sizes.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.