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

Forums

OverviewFelgo 3 Support (Qt 5) › TexturePackerAnimatedSprite

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #21128

    Isak

    Hello,

     

    I dont know what i am doing wrong, trying to use an texturepacker json file with an spritesheet but nothing shows. I have:

     

    TexturePackerAnimatedSprite {
    id: welcomeText
    source: "../assets/Images/StartSpritesheet.json"
    frameNames: "WelcomeText.png"
    x: 100
    y: 100

     

    }

     

    But when i try to run the code i get the following:

    Warning: TexturePackerSprite could not read the frame information in " "file:///home/isak/.local/share/FelgoLiveClient/pixelspacefight//assets/Images/StartSpritesheet.json\"."

     

    Earlier the path to the file got autocompleted but that dont happen anymore?

     

    /Isak

    #21195

    Günther
    Felgo Team

    Hi Isak,

    which platform or device are experiencing this problem on? Does it happen with Felgo Live or with custom build and deployment?

    I an run this snippet from the SDK examples on macOS for both Live Client and custom builds:

    import QtQuick 2.0
    import Felgo 3.0
    
    GameWindow {
      activeScene: scene
    
      Scene {
        id: scene
    
        // this uses a single animated sprite, easier access if you do not need to switch between multiple animations where only one is visible
        TexturePackerAnimatedSprite {
          id: squabySpriteAnimatedTP
    
          x: 20
          width: 32
          height: 32
    
          source: "squafurTP.json"
          frameNames: ["squafurY/squ1-walk-1.png", "squafurY/squ1-walk-2.png", "squafurY/squ1-walk-3.png", "squafurY/squ1-walk-4.png"]
          frameRate: 20
        }
    
      }// Scene
    }// GameWindow
    

     

    #21196

    Isak

    Hello Günther,

    I tried it in the live server on PopOS(based on Ubuntu), it is an older .json that i generated last year from texturepacker. Could it be that i need to genereate a new one? I am thinking that is says that it cant read the information.

    i even tried to put it in the qml folder but got the same error, is there an example with an json file bundled that i can test with?

     

    /Isak

    #21208

    Alex
    Felgo Team

    Hi Isak,

    you can find a TexturePacker example at Examples\Felgo\examples\sprites\spriteAnimations in your installation directory.

    Cheers,
    Alex

    #21209

    Isak

    Hello,

     

    I have now tested out that example and it works. I tested it in Windows 10 but i am sure it works in linux too. I compared mine with your json and it dosent look the same.

    Mine:

    {
    	"filename": "UpgradeButtonUp.png",
    	"frame": {"x":360,"y":451,"w":199,"h":79},
    	"rotated": false,
    	"trimmed": true,
    	"spriteSourceSize": {"x":1,"y":66,"w":199,"h":79},
    	"sourceSize": {"w":200,"h":200},
    	"pivot": {"x":0.5,"y":0.5}
    },

    Yours:

    "nailgun/1-shoot-3.png":
    {
    	"frame": {"x":571,"y":2,"w":29,"h":105},
    	"rotated": false,
    	"trimmed": true,
    	"spriteSourceSize": {"x":25,"y":0,"w":29,"h":105},
    	"sourceSize": {"w":80,"h":160}
    },

    I am guessing that i made the json in an earlier version of texturepacker, and the exporter has changed how it generate the json?

    Anyways it seems to work now i i am guessing i need genereate a new spritesheet to use with Felgo.

     

    /Isak

    #21222

    Günther
    Felgo Team

    Yes, please prepare you JSON in the format that works for Felgo. TexturePacker changes its JSON format from time to time, so some incompatibility is possible, until update the JSON format for the Felgo Sprite types as well.

    Best,
    Günther

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