Forums

OverviewV-Play 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
    V-Play 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
    V-Play 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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support