hello, i have a problem with my LevelEditor, i can’t drag&drop the BuildEntityButton to the scene.
i get following console Output (beginning at clicking to release)
BuildEntityButton: button MouseArea pressed, start dragging entity
BuildEntityButton: entity got pressed: EntityBaseDraggable_QMLTYPE_49(0x1105ace80, "platform_5") , for creationType: file:///Users/xxxx.app/Contents/Resources/qml/entities/Platform.qml
pos of createdEntity: 307.5 221.5
BuildEntityButton: button MouseArea released
EntityBaseDraggable: entityReleased position: 283 184.5 snapped position: 288 192
entity got released, create it at the position if allowed to build
EntityManager: createEntityFromUrl: file:///Users/xxxx.app/Contents/Resources/qml/entities/Platform.qml
[WARNING] EditableComponent construction without a defined and active ItemEditor. Ensure your Scene knows about the id: itemEditor or provide an explicit targetEditor!
Platform.onCompleted(): width: 50
file::/qml/VPlay/level/EntityBaseDraggable.qml:417: Unable to assign [undefined] to bool __buildPolygonCollider
file::/qml/VPlay/level/EntityBaseDraggable.qml:414: Unable to assign [undefined] to bool __buildCircleCollider
file::/qml/VPlay/level/EntityBaseDraggable.qml:411: Unable to assign [undefined] to bool __buildBoxCollider
EntityManager: adding a component for the entityType ' platform ' to the entityTypeAndVariationTypeToComponentMap
EntityManager: entity created with entityId: platform_13
GameWindow: creating cocos item in cocosWrapper triggered by JavaScript code explicitly: EntityBaseDraggable_QMLTYPE_49(0x113d83110, "platform_13")
The EntityBaseDraggable
said that position is 288,192, but there is no “platform” – why?
Platform.qml
import QtQuick 1.1
import VPlay 1.0
import Box2D 1.0 // needed for Body.Static
EntityBaseDraggable {
entityType: "platform"
// if the obstacle was pressed and held, remove it
onEntityPressAndHold: removeEntity()
// put them before the windows
z:1
width: 50
height: 8
Image {
id: sprite
source: "../img/platform.png"
anchors.fill: parent
}
BoxCollider {
id: collider
bodyType: Body.Static
anchors.fill: sprite
}
EditableComponent {
editableType: qsTr("Platform")
defaultGroup: "General"
properties: {
"width": {"min": 20, "max": 200, "stepsize": 1 },
"rotation": {"min": 0, "max": 360, "stepsize": 1 }
}
}
Component.onCompleted: console.debug("Platform.onCompleted(): width: "+width)
// Component.onDestruction: console.debug("Platform.onDestruction()")
}
BuildEntityButton:
....
Column {
BuildEntityButton {
id: hudBottomButton1
visible: hudBottom.visible
toCreateEntityType: "entities/Platform.qml"
creationProperties: { "width":50, "height":8} // tried with and without props
z: 1
width: 60
height: 20
// one Platform to add
Platform {
anchors.centerIn: parent
preventFromRemovalFromEntityManager: true
}
}
MenuText {
text: qsTr("Platform")
font.pixelSize: 12
}
}
...
Can you help me please?