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

Forums

OverviewFelgo 1 Support › SpriteBatchContainer and Flickable

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

    Heini

    Hi,

    in my project I am using a flickable with a SpriteSequence and some other items inside. I also added a SpriteBatchContainer to control the arrangement of the items and the Spritesequence. When I flick now, the Spritesequence is moving much faster, than the other items.

    Here is some code to try:

    <code class="language-qml">import VPlay 1.0
    import QtQuick 1.1
    
    GameWindow {
        activeScene: scene
    
        width: 960
        height: 640
        
        Scene {
            id: scene
    
            Flickable{
                id: flickable
                width: parent.width
                height: parent.height
                contentHeight: background.height
                contentWidth: background.width
    
                Rectangle{
                    id: background
                    color: "blue"
                    width: 1000
                    height: 1000
                    z: 1
    
    
                SpriteBatchContainer{
                    id: container
                    z: 2
                }
    
                    MySprite{
                        id: sprite
                        x: 500
                        y: 500
                        width: 100
                        height: 100
                    }
    
    
                    Rectangle{
                        id: testRect
                        color: "red"
                        width: 70
                        height: 100
                        x: 480
                        y: 480
                        z: 3
                        opacity: 0.5
                    }
    
    
                }//Background
    
    
            }//Flickable
            
        }//Scene
    }
    
    

    When you comment out the SpriteBatchContainer, the Spritesequence is placed/moving correctly, but I need a way to make the arrangement of the Spritesequence.

    Thanks,

    Heini

    #6666

    Alex
    Felgo Team

    Hi Heini,

    the SpriteBatchContainer must not be placed inside the Flickable, as the position of the SpriteSequence then gets calculated wrong like you are experiencing it.

    Can you put the Images that you are using to overlay the SpriteSequence in a Spritesheet too? Then you can order them correctly, it will however not work with Rectangles.

    Cheers,
    Alex

    #6672

    Heini

    Hi Alex,

    like suggested, I made it now by putting all images to stay on top in a SpriteSheet and it seems to work. It was a tricky part, because I have also an onscreen display and a screen popping up after finishing a level, that should cover the scene (with the sprites) but also be able to show some text. I wish, z-sorting with sprites would be easier…

    However, after adding the Spritesheet, i get now lots (hundrets?) of “cocos2d : getActionByTag: Target not found” in the console output. What does this mean?

     

    Cheers

    Heini

    #6678

    Christian
    Felgo Team

    Hi Heini,

    sorry for sprites & spritebatch handling being a bit tedious – we will improve that in the ucpoming major update. The log output got added by accident in the previous release, you can ignore it right now and we’ll remove it in the next daily build coming next week!

    Cheers, Chris

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