How do I effectively use BBox as a collision alternative?

0 favourites
  • 3 posts
From the Asset Store
Template for an alternative to falling shapes, fully documented in comments and video
  • First of all, I apologize, as this question has been asked in the community before, and the answer to this question is as follows:

    "Text.BBoxLeft < Sprite.BBoxRight && Text.BBoxRight > Sprite.BBoxLeft"

    However, I am unable to make it work. My requirement is simple: I just want to check whether a text and a sprite are overlapping to each other or not. If they are, then I want to perform certain actions.

  • I'm not sure what your intentions are with BBox, but if you want to check if a Sprite is overlapping any object, just use Sprite: Is Overlapping -> Object.

    Many object types don't have On Collision or Is Overlapping, but the Sprite object does and can always detect if it's overlapping with other objects.

    There's no direct way of checking if Text is overlapping something (although it's more-or-less the same thing), but if you really want to, you can create a new Sprite object and add it to a container for the Text Object. Set them to be the same size, and then use that Sprite object to detect collisions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure what your intentions are with BBox, but if you want to check if a Sprite is overlapping any object, just use Sprite: Is Overlapping -> Object.

    Many object types don't have On Collision or Is Overlapping, but the Sprite object does and can always detect if it's overlapping with other objects.

    There's no direct way of checking if Text is overlapping something (although it's more-or-less the same thing), but if you really want to, you can create a new Sprite object and add it to a container for the Text Object. Set them to be the same size, and then use that Sprite object to detect collisions.

    Thank you, it works. Also, thanks for the Container part; the tricks you gave have definitely enabled many things for me further.

    Here, I'm just curious if I can have the same question but for text, meaning, how can I check if two text objects are overlapping using BBox?

    Here is the original suggestion to solve this using BBox.

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