Forums

OverviewFelgo 2 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.

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