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

Forums

OverviewFelgo 4 Support (Qt 6) › anchors and gamewindow gameWindowAnchorItem broken in publish mode

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25240

    Bas

    hi,

    I am using GameWindow as the main item in Main.qml with an id:gameWindow

    In a Scene file i use some anchors for example to get a picture fullscreen and beyond the “save” zones.

    in “test” mode de anchors.fill: scene.gameWindowAnchorItem works fine and also anchors.fill: scene.fullWindowAnchorItem

    in “publish” mode i get an error : “TypeError: Type error” and it does not work anymore.

    somehow this works:

    anchors.left: scene.fullWindowAnchorItem.left
    anchors.top: scene.fullWindowAnchorItem.top
    anchors.right: scene.fullWindowAnchorItem.right
    anchors.bottom: scene.fullWindowAnchorItem.bottom

     

    any ideas?

    cheers,

    Bas

    #25241

    Bas
        Item {
            anchors.left: scene.fullWindowAnchorItem.left
            anchors.top: scene.fullWindowAnchorItem.top
            anchors.right: scene.fullWindowAnchorItem.right
            anchors.bottom: scene.fullWindowAnchorItem.bottom
            Image {
                id:bgImg
                opacity:0
                source:"https://somelink-to-an-image-here"
    //            anchors.fill: scene.gameWindowAnchorItem //scene.parent //scene.fullWindowAnchorItem
                anchors.fill: parent
                fillMode: Image.PreserveAspectCrop
                onStatusChanged: { if (status == Image.Ready) bgImg.opacity=1 }
                Behavior on opacity {
                    NumberAnimation {property: "opacity"; easing.type: Easing.Linear; duration: 350; }
                }
            }
        }
    

    this works for me

    #25243

    Günther
    Felgo Team

    Hi Bas,

    The QML anchoring mechanism itself is not modified by Felgo. Kind of strange that anchors.fill would no longer work while anchors.left still does. But glad to hear you got it working. I did a quick test with a simple example – for me everything does work fine in this simple setup at least.

    import Felgo
    import QtQuick
    
    GameWindow {
    
      // this rectangle fills the whole screen with grey
      Rectangle {
        color: "#f0f0f0"
        anchors.fill: parent
      }
    
      Scene {
        id: scene
    
        Rectangle {
          anchors.fill: scene.fullWindowAnchorItem
          color: "red"
        }
    
        Rectangle {
          anchors.fill: scene.gameWindowAnchorItem
          color: "cyan"
        }
    
        Text {
          text: "Welcome to Felgo"
    
          font.pixelSize: 16
          anchors.centerIn: parent
        }
      }
    }
Viewing 3 posts - 1 through 3 (of 3 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