Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Circle

A circular physics shape. More...

Import Statement: import Felgo 4.0
Inherits:

Fixture

Inherited By:

RubeFixtureCircle

Properties

Detailed Description

Property Documentation

radius : real

This property holds the radius of the Circle in pixels. If you use a Circle shape, this property must be set! The default value is 0.

The collider will align its top left corner with the top left corner of the target Item. To correctly align the circle center, the target's width and height should be radius * 2. You can set it to half of the width of a round entity to approximate the physics shape from the Image like in this example:

 EntityBase {
  entityId: "circle1"
  entityType: "circle"
  width: circleImage.width
  height: circleImage.height

  Image {
      id: circleImage
      source: "img/circle.png"
      anchors.centerIn: parent // the CircleCollider has its origin in the top-left
  }
  CircleCollider {
    // approximate the collider with the image size - if the image is circular, this is a good approximation
    radius: circleImage.width/2
  }
 }

x : real

This property allows to change the x position of the Circle's center.


y : real

This property allows to change the y position of the Circle's center.


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded