Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How to make button with non standard shape — Gideros Forum

How to make button with non standard shape

Fill_os_OFFFill_os_OFF Member
edited June 2017 in General questions
Hi all!
I'm a little bit confuse. I was trying to make a button with non standard shape (the shape that is hard to create using Path2D or Shape).
I took image that has this shape. The image is, for example, 200x200 square with transparent parts.
So, when I am using hitTestPoint function is says 'yes' for all 200x200 pixels of my image. I was trying to use setBlendMode with masking, but it didn't help me.

I've managed to do this by using RenderTarget and modifying background of my image from transparent to black, but it doesn't seem to be the best way.
Do you have any suggestions? Maybe I've missed some simple solution?

P.S. My solution is in attachment
zip
zip
test.zip
5K

Comments

  • antixantix Member
    @Fill_os_OFF if you check the alpha then you should be fine
      if alpha == 0 then
  • @Fill_os_OFF if you check the alpha then you should be fine
      if alpha == 0 then
    Thank you! yes, of course it will work too.
    But I want to ask if someone know any ways to do it without RenderTarget and checking the pixels?
  • only RenderTarget has getPixel method, so i don't thinnk there is a simpler way.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.