Forums

OverviewV-Play 1 SupportLevelEditor: cant drag&drop/place BuildEntityButton › Reply To: LevelEditor: cant drag&drop/place BuildEntityButton

OverviewV-Play 1 SupportLevelEditor: cant drag&drop/place BuildEntityButton › Reply To: LevelEditor: cant drag&drop/place BuildEntityButton
#6421

V-Play User

i have now changed the Platform.qml to:

import QtQuick 1.1
import VPlay 1.0
import Box2D 1.0 // needed for Body.Static

EntityBaseDraggable {
    entityType: "platform"
    //    poolingEnabled: true
    // if the obstacle was pressed and held, remove it
    onEntityPressAndHold: removeEntity()

    // put them before the windows
    z:1
    width: 50
    height: 8

    //    property alias spriteWidth: sprite.width

    Image {
        id: sprite
        source: "../img/platform.png"
        //        anchors.fill: parent
        width: parent.width
        height: parent.height
    }
    property alias collider: collider
    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()")

    // this property must be set for EntityBaseDraggable
    selectionMouseArea.anchors.fill: sprite
    // for collision detection while dragging, also define colliderComponent
    colliderComponent: collider
    //    dragOffset:Qt.point(10,10)
}

Now i get only the Console Output:

EntityBaseDraggable: entityReleased position: 5 6 snapped position: 0 0

i made a video:

https://www.dropbox.com/s/cicgmj9srlb0e5h/vPlayLevelEditor.mov

 

i hope you can help :)

 

 

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support