Forums

OverviewV-Play 1 SupportBuildEntityButton – Properties › Reply To: BuildEntityButton – Properties

OverviewV-Play 1 SupportBuildEntityButton – Properties › Reply To: BuildEntityButton – Properties
#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

 

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