← Back to Docs
  • index.html
  • Clayground
  • Clayground.Physics
  • ImageBoxBody
  • Clayground 2025.2
  • ImageBoxBody QML Type

    Image-based physics body with Box2D box collision. More...

    Import Statement: import Clayground.Physics

    Detailed Description

    ImageBoxBody displays an image and provides a rectangular box fixture for physics collision. Useful for sprites that need physics interaction.

    Example usage:

    import Clayground.Physics
    import Box2D
    
    ImageBoxBody {
        source: "coin.png"
        xWu: 10; yWu: 5
        widthWu: 0.5; heightWu: 0.5
        bodyType: Body.Static
        sensor: true
    }

    Properties

    The Box2D box fixture.

    Image source URL.

    How the image fills its area.

    Mirror the image horizontally.

    Tile width for repeating images in world units.

    Tile height for repeating images in world units.

    Fixture density affecting mass.

    Friction coefficient (0-1).

    Bounciness coefficient (0-1).

    If true, detects collisions without physical response.

    Collision category bits.

    Collision mask bits.

    Collision group index.