← Back to Docs
  • index.html
  • Clayground
  • Clayground.World
  • Minimap2d
  • Clayground 2025.2
  • Minimap2d QML Type

    Miniature map view of a 2D world. More...

    Import Statement: import Clayground.World

    Detailed Description

    Minimap2d displays a scaled-down view of a ClayWorld2d, showing entities as simple shapes based on type mapping.

    Example usage:

    import Clayground.World
    
    Minimap2d {
        world: gameWorld
        width: 200; height: 150
        anchors.right: parent.right
        anchors.top: parent.top
    
        typeMapping: new Map([
            ["Player", playerDotComponent],
            ["Enemy", enemyDotComponent]
        ])
    
        Component { id: playerDotComponent; Rectangle { color: "green" } }
        Component { id: enemyDotComponent; Rectangle { color: "red" } }
    }

    Properties

    The world to display. Required.

    Map of entity type names to QML Components for rendering.