Forums

OverviewFelgo 1 Support › Flickable

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #4481

    Heini

    Here is some of the flickable code:

    
            Flickable{
            id: flickOriginal
    
            height: level1.height - menu.height
            width: height
            x: 0 - anchors.rightMargin
            anchors.rightMargin: 2
    
            clip: true
    
    
            Image{
                id: original
                source: "Levels/Original1.JPG"
                height: level1.height - menu.height
                width: 500 * scalefactor
                x: 0 - anchors.rightMargin
                anchors.rightMargin: 2
    
    
                MouseArea{
                    id: mouseareaOriginal
                    anchors.fill: parent
    
                    onPressed: {
                        if (isLupeEnabled)
                        {
                            //Verhältnis zwischen Bildgroesse und Mouseposition berechnen
                            var mouseRatioX = mouseX / original.width
                            var mouseRatioY = mouseY / original.height
    
                            zoomIn (mouseRatioX, mouseRatioY);
                        }
                    }
                }
    
                }
            }
        }

    There is a zoom-button in the game menu. After activating it, the player has to touch the point in the flickable, he wants to zoom in.

    #4496

    Heini

    Hi Chris,

    regarding the contentY property, i´m not able to make it run correctly. It is another flickable for the highscore. Please try the following code and tell me what i´m doing wrong. In this example i try to navigate to the 35th item, that has another image as the others. It wont work…

    import VPlay 1.0
    import QtQuick 1.1
    
    GameWindow {
        activeScene: scene
    
        width: 960
        height: 640
        
        Scene {
            id: scene
    
            property int itemHeight: 20
    
            Component {
                id: levelItemDelegate
    
                Image{
                    id: testimage
                    height: scene.itemHeight
                    width: scene.width *0.75
                    source: index === 35 ? "flickBack1.png" : "flickBack.png"
    
                }
            }
    
            Flickable {
                id: flickable
                anchors.centerIn: parent
    
                width: scene.width * 0.75
                height: scene.height * 0.8
    
                contentWidth: column.width
                contentHeight: column.height
                flickableDirection: Flickable.VerticalFlick
    
                clip: true //doesn´t matter
    
                Column {
                    id: column
                    anchors.centerIn: parent
    
                    Repeater {
                        id: repeater
                        model: 100
                        delegate: levelItemDelegate
    
                    }
                }
            }
           Component.onCompleted: {
    
               var zentralItemIndex = (scene.height/2) / scene.itemHeight;
    
               flickable.contentY = (35 * scene.itemHeight) - (zentralItemIndex * scene.itemHeight)
    
    
           }
    
        }
    }
    

    Thank you!

    #4517

    Christian
    Felgo Team

    Hi Heini,

    appearantly you discovered another issue we had with the Flickable element: as you reported, setting the contentY propert in onCompleted had no effect. I fixed this issue, and it will be available with the next update. In the meantime, you could use a Timer element with a short one-shot interval of about 100ms, and set the contentY property in the onTriggered function there. Sorry for the inconvenience and thanks for finding & reporting this bug!

    Cheers, Chris

    #4518

    Christian
    Felgo Team

    Regarding the clipping issue:

    clipping is not supported yet. If you would urgently need it, please add a request in the roadmap forums, we will have a look how long it would take to implement it. Could you post a full example of the 2 flickable elements you mentioned please, so we can get a clearer picture of your requirements?

    Cheers again, Chris

    #4690

    Christian
    Felgo Team

    Hi Heini,

    I’m happy to tell you we added support for the clip property in the Flickable today in the daily builds.

    Cheers, Chris

    #4698

    Heini

    Great, thank you!

    #4701

    Heini

    Hi,

    clipping does still not work for me. Having 2 flickables side by side (each one scrollable horizontal and vertical) , the content of the one is moving out of its borders and overlapping the other one (tested on Android).

    Heini

    #4702

    Christian
    Felgo Team

    Hi,

    to activate daily builds, please set the sdk property in config.json to “daily”. By default, you build against the latest stable version (which is 1.3 currently). Just let us know if it works then for you.

    Cheers, Chris

    #4703

    Heini

    Hi Chris,

    this doesn´t change anything. I downloaded and installed the daily builds, i added “CONFIG += v-play_daily” to my pro file and i set sdk to daily, as suggested above. Maybe there is to setup something else? When i try to use the new Clipping item, it gets underlined red, just like it would not be included to the libs.

     

    Greetings

    Heini

    #4704

    Christian
    Felgo Team

    Hi,

    did you clean your build and run qmake after changing to daily build in the pro file? Do you also have the latest version 1.3.2 installed as shown in the blog post (there version 1.3.1 is shown, it should be v1.3.2 now)? To be sure which version was used for your build on the build server, please check the log output and send me which version was used for it.

    Cheers, Chris

    #4705

    Heini

    Hi Chris,

    my pro file was not up to date. Now i started a new project and added my qlm files manually and it works fine! Thank you for adding this feature!

     

    Have a nice weekend!

    Heini

Viewing 11 posts - 16 through 26 (of 26 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