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

Forums

OverviewFelgo 3 Support (Qt 5) › Strange beaviour when previewing on mobile

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20071

    Isak

    Hello,

     

    I have been creating an spacegame and have now started to preview my game on my android One Plus 3T with the Felgo-Live app but i get strange behaviors, things that works great in the emulator now behaves very strange. For example look at the attached image on the left is the emulator and on the right when previewed on my One Plus 3T.

    • The text is MUCH bigger on the device, i am using font.pointsize to set the size of the text is this what does this? How should i control the size so that it looks good on all devices?
    • The ship appears to be outside my screen on the device, shouldn’t it be placed at the same place as in the emulator? I am using Numberanimation with this setting: to: scene.gameWindowAnchorItem.height – ship.height * 1.2

    Is the Felgo Live app faulty or is it my code that is faulty?

     

    Hoping someone can help me with this problem?

     

    P.S is it possible to insert an image in the forum? I inserted an link because i didn’t know how to insert an image. D.S

     

    /Isak

     

    https://imgur.com/a/7ehQOA9

    #20075

    Alex
    Felgo Team

    Hi,

    please use font.pixelSize instead.

    The issue with your positioning at the screen bottom is (most likely) the following: I’ll ignore the ship height for this example. With the aspect ratio of your 3T device, the Scene is, lets say 12cm in height, and centered in the screen which is maybe something like 14cm in height. This means the scene starts at 1cm from the top. Now you position your ship at 14cm, but relative to the scene, which begins at 1cm, so effectively it’s positioned at 15cm, on a 14cm screen, so it’s actually 1cm outside of the screen. The solution is to also substract the upper border (scene.gameWindowAnchorItem.height – scene.height) / 2.

    Then you can also substract your ship height and all should be fine. The emulator has another aspect ratio, that’s why it looked different.

    I hope that is understandable, let me know if you manage to fix it.

    Cheers,
    Alex

    #20090

    Isak

    Hello Alex,

    i used pointsize because i found in some documentation that i should use that for screens with different sizes but now when i use pixelSize it works great with the text.

    I dont get the ship to position correctly i have:

     

    NumberAnimation {
                id: shipMainMenuAnimation
                target: ship
                running: splash === true
                property: "y"
                duration: 800
                to: (scene.gameWindowAnchorItem.height - scene.height) / 2 - ship.height
                easing.type: Easing.InOutQuad
            }

    Is this not correct? The ships animates to the middle of the screen? I am really confused right now…

     

    /Isak

     

    #20147

    Günther
    Felgo Team

    Hi Isak,

    As this is a very use-case and project specific question, we can only help with dedicated coding support, or e.g. develop features for you! One of our devs can take care of it with the purchase of a support package. Just get in touch at support@felgo.com.

    Best,
    Günther

Viewing 4 posts - 1 through 4 (of 4 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