Forums

OverviewV-Play 1 Support › BuildEntityButton – Properties

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5211

    Saims

    Hi,

    I got one more question concerning the BuildEntityButton and the properties.

    So setting properties like a rotation works fine when dragging an entity into the game. But when I now have e.g. my wall with a rotation of 45, that I already dragged into the game, and I want to change it’s position by picking it up again, and moving it around, it loses it’s set property. Meaning in my case I dragged a wall with rotation 45 into the game, and after picking it up again, the rotation got reset to 0.

    Is this a known bug, or can I do anything against it?

    #5225

    Alex
    V-Play Team

    Hi, we can reproduce the problem and are currently investigating the issue. I’ll let you know as soon as we got a solution for you.

    Best Regards,

    Alex

    #5260

    Alex
    V-Play Team

    Hi again,

    a possible workaround would be not to set the rotation of the EntityBaseDraggable, but instead the rotation of all its children.

    import QtQuick 1.1
    import VPlay 1.0
    import Box2D 1.0
    
    EntityBaseDraggable {
      id: obstacle
      entityType: "obstacle"
    
      property int size: 64
      property alias rectRotation: rectangle.rotation
      property alias collRotation: collider.rotation
    
      width: size
      height: size
    
      colliderSize: size
    
      colliderComponent: collider
      selectionMouseArea.anchors.fill: collider
    
      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
        bodyType: Body.Static
      }
    }

    And then call this in your BuildEntityButton:

    creationProperties: { "rectRotation" : 45, "collRotation" : 45 }

    Is this sufficient for your demand?

    Best Regards,
    Alex

     

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

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