Forums

OverviewV-Play 1 Support › Is Draggable in Flickable Doable?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5249

    Martin

    In the level editor we (may) have quite a few building blocks for the levels. Thus, a scrolling list would be in order which can (a) be flicked (say vertically) and from which (b) entities can be dragged (say horizontally). However, the problem is that the draggable entities would not allow the Flickable to be flicked but prefer to be dragged on any occasion. It hence would be great if you could either (a) provide a work-around for this problem or (b) add a draggable direction flag as in Flickable to EntityBaseDraggable.

    Here is some sample code to be used with the setup in this post.

    Cheers, Martin

            Column {
                id: rightcolumn
    
                anchors.right: parent.right
                anchors.top: parent.top
                spacing: 5
    
                Clipping {
                    width: scene.width / 5
                    height: scene.height
    
                    Rectangle {
                        width: scene.width / 5
                        height: scene.height
                        z: 0
                        color: "grey"
                    }
    
                    Flickable {
                        width: parent.width
                        height: parent.height
    
                        contentWidth: column.width
                        contentHeight: column.height
                        focus: true
                        interactive: true
                        enabled: true
                        flickableDirection: Flickable.VerticalFlick
    
                        Column {
                            id: column
                            spacing: 5
                            anchors.centerIn: parent
    
                            Repeater {
                                model: 10
                                BEButton {
                                }
                            }
                        }
                    }
                }
            }

     

    #5262

    Martin

    Has really never anyone thought about or done this? I think using a Flickable for the list of level items (EntityBaseDraggables) is quite convenient and space-efficient. Any workarounds or solutions for this?

    Cheers, Martin

    #5263

    Alex
    V-Play Team

    Hey Martin,

    we are already discussing the issue and it’s possible solution.

    The problem is that the MouseArea in the BuildEntityButton is using drag, and this prevents the Flickable from stealing the MouseEvent. Therefore we might have to change the internals of the BuildEntityButton to solve this issue. We release a new daily build this week and we’ll try our best to add a fix for this.

    Best Regards,
    Alex

    #5265

    Alex
    V-Play Team

    Another possible workaround which could also be sufficent with the current version of the BuildEntityButton:

    Have a look at the Flickable::pressDelay property. If you set it to e.g. 500, it would mean that if the user starts moving vertically within 500ms, it will cause flicking, if the user remains on the position for 500ms, the press event gets passed to the BuildEntityButton.

     

    Cheers,
    Alex

     

    #5266

    Martin

    Thanks a bunch, Alex. That seems like a feasible workaround. Will have to test it on some devices but on desktop it looks promising.

    Cheers, Martin

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