Hi there,
our game has different layers which are implemented with the nice ParallaxItem component in the entities. Moreover, we would like to build the levels with the LevelEditor and thus have EntityBaseDraggable components like the following one.
import QtQuick 1.1
import VPlay 1.0
import Box2D 1.0
EntityBaseDraggable {
id: obstacle
entityType: "obstacle"
width: size
height: size
property int size: 64
property alias color: rectangle.color
colliderComponent: collider
selectionMouseArea.anchors.fill: rectangle
gridSize: size
colliderSize: width
ParallaxItem { // this seems to be a problem?! without it, everything works fine...
ratio: 1.4
Rectangle {
id: rectangle
color: "yellow"
x: -obstacle.width / 2
y: -obstacle.height / 2
width: obstacle.width
height: obstacle.height
}
BoxCollider {
id: collider
x: -obstacle.width / 2
y: -obstacle.height / 2
bodyType: Body.Static
}
}
}
Unfortunately, this does not work and the error message is not comprehensible [to me at least], i.e.,
file::/qml/VPlay/level/BuildEntityButton.qml:338: TypeError: Result of expression 'createdEntity' [undefined] is not an object.
file::/qml/VPlay/level/BuildEntityButton.qml:336: TypeError: Result of expression 'createdEntity' [undefined] is not an object.
BuildEntityButton: button MouseArea pressed, start dragging entity
file::/qml/VPlay/level/BuildEntityButton.qml:302:3: QML MouseArea: mapToItem() given argument "undefined" which is neither null nor an Item
If one removes ParallaxItem (or just replaces it by Item), everything seems to work just fine. So what is the problem and how can this be resolved?
Cheers, Martin