Check collision between 9patch and text objects?

From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hello!

    I use 9patch objects for my buttons. How can I check the collision between text objects and 9patch objects as both do not have "on collision with another object"-events?

  • They don't have collision, what are you trying to do?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just trying to delete all text with the exception of button text. But I guess I will just use other text objects for button text then. Might also have better performance than checking collisions etc. .

  • You can check if two objects are overlapping using "Pick by evaluate" condition with this expression:

    Text.BBoxLeft<9Patch.BBoxRight & Text.BBoxRight>9Patch.BBoxLeft & Text.BBoxTop<9Patch.BBoxBottom & Text.BBoxBottom>9Patch.BBoxTop

  • Just trying to delete all text with the exception of button text. But I guess I will just use other text objects for button text then. Might also have better performance than checking collisions etc. .

    If it is just to pick the objects without involving any overlap check you could add an instance variable or boolean and check Pick by comparison, this is assuming that you don't really need to check for overlaps

  • Thank you for both of your suggestions. I'm sure these will come in handy in the future. For now I will just use separate text objects for regular text and for button text.

    Stupid me was too fast with posting before thinking. But now I know two alternative solutions for future problems. :D

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)