Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

StackTheBoxWithEditor Demo

 import QtQuick 2.0
 import Felgo 3.0
  // for accessing the Body.Static type

 EntityBaseDraggable {
   id: obstacle
   entityType: "obstacle"

   width: 32
   height: 32

   colliderComponent: collider

   selectionMouseArea.anchors.fill: rectangle

   // the gridSize can also be smaller than the width, then the levels do not look as blocky and it is not a real grid
   gridSize: 16
   colliderSize: width

   // this item will blink when the entity is selected
   opacityChangeItemWhileSelected: rectangle

   onEntityClicked: scene.entitySelected(obstacle)

   // if the obstacle was pressed and held, remove it
   onEntityPressAndHold: removeEntity()

   Rectangle {
     id: rectangle
     color: "grey"
     x: -width/2
     y: -height/2
     width: parent.width
     height: parent.height
   }
   BoxCollider {
     id: collider
     x: -width/2
     y: -height/2
     // this is set automatically from BoxCollider
 //    width: parent.width
 //    height: parent.height

     // use "" to access the Body.Static type
     bodyType: Body.Static // the body shouldnt move
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded