Forums

OverviewV-Play 2 Support (Qt 5)JoystickControllerHUD issue › Reply To: JoystickControllerHUD issue

OverviewV-Play 2 Support (Qt 5)JoystickControllerHUD issue › Reply To: JoystickControllerHUD issue
#12120

Prashant
Hi Chris ,
thank for the reply here is the code.

import QtQuick 2.0
import VPlay 2.0

Scene {
    id: mainScreen

    Item {
        id: leftThumb
        height: 310
        width: 340


        MouseArea {
            anchors.fill: parent
            onPressed: {
                joystickleft.opacity =1
                joystickleft.x1 = mouse.x -joystickleft.joystickRadius
                joystickleft.y1 = mouse.y-joystickleft.joystickRadius

            }

        }


        JoystickControllerHUD {
            id: joystickleft
            property double x1 : 0
            property double y1 : 0
            x: x1
            y: y1
            joystickRadius: parent.width/4
            thumbRadius : joystickRadius/3
            source: "../../assets/img/joystickScreen/LeftCircle.png"
            thumbSource: "../../assets/img/Ellipse.png"
            onControllerXPositionChanged: console.debug(controllerXPosition)
            onControllerYPositionChanged:  console.debug(controllerYPosition)
            opacity: 0
        }

    }



}





    

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