Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Under Android MultiResolutionImage (called from RUBE) can't find images

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

    Larry

    Hurray my first app is running!  (I really just copied the RUBE penguin game and changed things around).  It plays great on Windows, on MacOS, and in the IOS simulator.

     

    So I installed it on my Android phone, and the game plays.  However, the images controlled/loaded by RUBE are all missing.  Any RUBE entities where I replace the image/sprite using QML code work fine (so my character, challenges on screen, etc show up fine).  But the images controlled/loaded by RUBE are all black.  And, in the Application Output window I see errors that the images are missing!!

     

    Here’s the strange thing.  The same directory that stores images like “sky-background.png” also hold images like “lightning.png”.  My QML code displays the lightning and it shows up fine.  The sky-background image is controlled by RUBE, and it reports as missing.  You can see the errors below, and I also show the files present in the build directory (holding both sky-background and lightning).  So the files are there, but RUBE parser / entity manager can’t find them.

     

    So, I assume this has something to do with assets, relative path, maybe qrc (which I’m not using), rube entity manager, etc. but I can’t figure it out.  Can anyone suggest how to fix this?

    W MySimpleApp: qrc:/qml/VPlay/sprites/MultiResolutionImage.qml:237:3: QML Image: Cannot open: assets:/assets/rube/../../assets/img/sceneplay/level0/sky-background.png
    W MySimpleApp: qrc:/qml/VPlay/sprites/MultiResolutionImage.qml:237:3: QML Image: Cannot open: assets:/assets/rube/../../assets/img/sceneplay/level0/background-bottom-9.png
    W MySimpleApp: qrc:/qml/VPlay/sprites/MultiResolutionImage.qml:237:3: QML Image: Cannot open: assets:/assets/rube/../../assets/img/sceneplay/level0/background-top-10.png
    W MySimpleApp: qrc:/qml/VPlay/sprites/MultiResolutionImage.qml:237:3: QML Image: Cannot open: assets:/assets/rube/../../assets/img/sceneplay/level0/background-bottom-7.png
    
    VM-Host-1-Mac-1:build-MySimpleApp-Android_for_arm64_v8a_Clang_Qt_5_13_2_for_Android_ARM64_v8a-Debug admin$ ls android-build/assets/assets/img/sceneplay/level0/
    +hd				background-bottom-6.png		background-top-5.png
    +hd2				background-bottom-7.png		background-top-6.png
    antenna.png			background-bottom-8.png		background-top-7.png
    background-bottom-0.png		background-bottom-9.png		background-top-8.png
    background-bottom-1.png		background-top-0.png		background-top-9.png
    background-bottom-10.png	background-top-1.png		firework-explode.png
    background-bottom-11.png	background-top-10.png		firework-flame.png
    background-bottom-12.png	background-top-11.png		firework-idle.png
    background-bottom-13.png	background-top-12.png		graduation-cap.png
    background-bottom-14.png	background-top-13.png		lightning.png
    background-bottom-2.png		background-top-14.png		rocket-idle.png
    background-bottom-3.png		background-top-2.png		rocket-smoke.png
    background-bottom-4.png		background-top-3.png		sky-background.png
    background-bottom-5.png		background-top-4.png		tanker-spray.png
    

     

    I compared the Windows build to the Android build, and the structure and location of my png files is unchanged.  Somehow under Android the Felgo MultiResolutionImage is not finding the png file!

     

    Stuck 🙁

    #23802

    Alex
    Felgo Team

    Hi Larry,

    Looking at the sidescroller.json file content, are relative paths to the images correct within your assets folder?

    Best,

    Alex from Felgo

    #23803

    Larry

    Yes, the paths are correct (confirmed by the ‘ls’ output above).  Interestingly the game plays fine on Windows, Mac, and IOS (simulator).  So I think if the paths were wrong they would all have the same problem?   My file structure is:

    MySimpleApp
     |
     +--qml
     +--assets
          |
          +--rube
          |    |
          |    +--sidescroller.json
          |
          +--img
          |    |
          |    +--lightning.png
          |    +--skybackground.png

     

    As a test, I moved my assets into QRC files and then everything plays fine even on android.  So this seems like a MultiResolutionImage issue

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

RSS feed for this thread

You must be logged in to reply to this topic.