Forums

OverviewV-Play 1 SupportAnchor wall to bottom of screen not working. › Reply To: Anchor wall to bottom of screen not working.

OverviewV-Play 1 SupportAnchor wall to bottom of screen not working. › Reply To: Anchor wall to bottom of screen not working.
#6764

lolly-pop

hi, here is the simplified code, i observed that the BoxCollider is not on the right place when switching through different screens…

well you should ave a log at this code in “setQmlRendererEnabled” mode, so you can see the BoxCollider is in some aspectRatios below the orange ground rectangle.

import VPlay 1.0
import QtQuick 1.1

GameWindow {

  activeScene: scene

  width: 640/2
  height: 1136/2

  Scene {

    id: scene
    width: 320
    height: 480

    PhysicsWorld {
      id: physicsWorld
      z: 10
      updatesPerSecondForPhysics: 60
      gravity.y: -10
      velocityIterations: 5
      positionIterations: 5
    }

    EntityBase{

      x: scene.gameWindowAnchorItem.width/2
      y: scene.gameWindowAnchorItem.height/2

      CircleCollider{

        id: collider
        radius: 20
        bodyType: Body.Dynamic
        restitution: 1
      }
    }

    Rectangle {

      id: loader
      anchors.fill: parent

      Rectangle{

        id: level
        color: "lightblue"
        anchors.centerIn: parent
        height: scene.gameWindowAnchorItem.height
        width: scene.gameWindowAnchorItem.width

        Rectangle{

          id: ground
          height: 20
          color: "orange"

          anchors{
            left: parent.left
            right: parent.right
            bottom: parent.bottom
          }

          BoxCollider {
            bodyType: Body.Static
          }

        }
      }

    }
  }
}

 

appreciating your help

edi

  • This reply was modified 4 years, 4 months ago by  nixo33322342.
  • This reply was modified 4 years, 4 months ago by  Christian.
  • This reply was modified 4 years, 4 months ago by  Christian.

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