phreaknation Posted June 21, 2013 Share Posted June 21, 2013 I am making a gui that has textures with transparent and I want to create a mask that allows for clicking through that area. More or less if mouse coord is inside the transparent part of the image, negative part of mask, click does not register on that object. Does not have to be fancy just a function that if x/y is inside of the mask return false(not on sprite/texture). I am not sure if this can be done by the collision but would be awesome if it could. Masks would be a great addition if not already in, as I have not fount any) Quote Link to comment Share on other sites More sharing options...
xerver Posted June 21, 2013 Share Posted June 21, 2013 Define a custom `hitArea` for that Sprite. Quote Link to comment Share on other sites More sharing options...
phreaknation Posted June 26, 2013 Author Share Posted June 26, 2013 I have an image that has a transparent section that I want to click through with the mouse. It is kind of a U shape on top of a diamond so there are lots of clickable areas inside of this image due to the transparent section. Notice the bottom part of the gui. The left side hides and shows so no worries since its vertical and has no curves but the bottom section doesnt hide and has the curve to it. Now the GUI is made in html but I am swapping it to pixi but I see no advantage since I had done that and still ran into the transparent section not allowing click through. I am not worried about showing code since it spans three or four files. I just need a way, or method to do it and I will worry about the coding part. Quote Link to comment Share on other sites More sharing options...
xerver Posted June 26, 2013 Share Posted June 26, 2013 I just told you, define a custom `hitArea` for the object. It can be any generic polygon. That way only the area you define is clickable, and not the whole sprite. Quote Link to comment Share on other sites More sharing options...
phreaknation Posted July 3, 2013 Author Share Posted July 3, 2013 Gotchya my bad on that one. Was at work when I posted that. Will pay more attention next time. Will look into it and update this as needed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.