The tap area is bigger than the button image.

I have created a button and a tap function. When i Click on the image it will print “Pressed and released”. But somehow there is an invisible square around that button. So when i tap a bit outside of the button the tap will still be registered. So how can this be solved?

Hi @joshuaromilgeorge,

How did you create your button? Can you post the image that you’re using for this? Just click the “More Reply Options” button below the response text window, and on the next screen you’ll see a button to upload the image.

Thanks,

Brent

This sucks, my file size is 2400 KB which is more than 1.95MB. What should I do now?

Hi @joshuaromilgeorge,

Can you just shrink it down using any image editor? We only need to see the basic shape of the button… it doesn’t need to be super-high detail.

Thanks,

Brent

Hi Brent! 

Sorry for not answering. But the whole problem is that somehow i get a invisible background with the image. Well when i open the image with Paint. There is a white background. But when i open it as a normal png file. There is no background visible. Just the image itself. My question is now, how can i get rid of the background so i only get the image left?

Josh

http://docs.coronalabs.com/api/type/DisplayObject/setMask.html

I ran into this problem with one of my games, and the problem was that there was just too much blank space around the button. The problem might be your image editor. Far as I know, Paint does not save PNGS with transparency.

Try opening it in Photoshop, hold Command(Ctrl on PC) while clicking on your button layer, and then crop and save as a PNG.

On Mac, there’s a free program called Pngyu that will let you shrink your PNG files. Not sure if there’s something similar for PC.

Too bad i coudlnt fit my whole image into this forum. Otherwise i would post and show it for you. But the image size is to big and i dont know how to make it smaller…

Send me a pm with your email. I can try it out on my end

Hi @joshuaromilgeorge,

How did you create your button? Can you post the image that you’re using for this? Just click the “More Reply Options” button below the response text window, and on the next screen you’ll see a button to upload the image.

Thanks,

Brent

This sucks, my file size is 2400 KB which is more than 1.95MB. What should I do now?

Hi @joshuaromilgeorge,

Can you just shrink it down using any image editor? We only need to see the basic shape of the button… it doesn’t need to be super-high detail.

Thanks,

Brent

Hi Brent! 

Sorry for not answering. But the whole problem is that somehow i get a invisible background with the image. Well when i open the image with Paint. There is a white background. But when i open it as a normal png file. There is no background visible. Just the image itself. My question is now, how can i get rid of the background so i only get the image left?

Josh

http://docs.coronalabs.com/api/type/DisplayObject/setMask.html

I ran into this problem with one of my games, and the problem was that there was just too much blank space around the button. The problem might be your image editor. Far as I know, Paint does not save PNGS with transparency.

Try opening it in Photoshop, hold Command(Ctrl on PC) while clicking on your button layer, and then crop and save as a PNG.

On Mac, there’s a free program called Pngyu that will let you shrink your PNG files. Not sure if there’s something similar for PC.

Too bad i coudlnt fit my whole image into this forum. Otherwise i would post and show it for you. But the image size is to big and i dont know how to make it smaller…

Send me a pm with your email. I can try it out on my end