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

Forums

OverviewFelgo 3 Support (Qt 5) › Fill HUD width

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17528

    Isaac

    Hi

    I am trying to create a HUD but when I change to iPad, I see space on the right hand. https://snag.gy/fAns9J.jpg

     

    This is my code:

    import Felgo 3.0
    import QtQuick 2.0
    
    GameWindow {
        id: gameWindow
    
        screenHeight: 960
        screenWidth: 640
    
        Scene {
            id: scene
    
            width: 320
            height: 480
    
            property int score: 0
            Rectangle {
                anchors.fill: scene.gameWindowAnchorItem
                color: "#000"
            }
    
            Rectangle {
                width: scene.gameWindowAnchorItem.width
                height: 50
                color: "#252326"
                anchors.top: scene.gameWindowAnchorItem.top
                anchors.horizontalCenter: scene
            }
    
            Text {
                text: "Score " + scene.score
                color: "white"
                anchors.horizontalCenter: scene.gameWindowAnchorItem.horizontalCenter
                anchors.top: scene.gameWindowAnchorItem.top
            }
    
            Column {
                anchors.centerIn: parent
                spacing: 10
    
                PlayBtn {
                    labelText: "Add 1"
                    onClicked: {
                        scene.increaseScore(1)
                    }
                }
    
                PlayBtn {
                    labelText: "Add 10"
                    onClicked: {
                        scene.increaseScore(10)
                    }
                }
    
            }
    
            function increaseScore(amount) {
            scene.score += amount
            }
    
        }
    }

     

    #17531

    Isaac

    OK fixed

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

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded