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

Forums

OverviewFelgo 1 Support › BuildEntityButton clicking

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

    Martin

    For convenient level construction, we would like to enable the user to just click on a BuildEntityButton (to select the entity type) and then click in the level to create a new entity at that location. Unfortunately, this message is printed and morover there is no click signal in BuildEntityButton

    BuildEntityButton: button MouseArea clicked
    EntityBaseDraggable: selectionMouseArea was clicked, but clicking is not allowed

    What can be done? We still want to keep the option to drag&drop new entities.

    Cheers, Martin

    #5977

    Alex
    Felgo Team

    Hi Martin,

    I fear that’s not quite possible with the current version of the BuildEntityButton. When interacting with the BEButton, the signals are forwarded to an invisible (gets visible upon interaction) EntityBaseDraggable, that you can then drag around to determine the spot where to build your Entity. We disabled clicking (selecting) of that Entity, since we only wanted it to get dragged and dropped to the spot where the actual, full functional, Entity gets built afterwards (that’s why you receive the log output).

     

    If i understand you correctly, you are looking for something like selecting a type of entity by clicking the button and then place one after the other on the scene just by clicking? Would it be enough for you if we add a BuildEntityButton clicked signal to give you the information which of the BEButtons was selected, and you add the logic to build the selected entity with a click on the scene yourself?
    I was thinking of something like this:

    import QtQuick 1.1
    import VPlay 1.0
    
    BuildEntityButton {
        id: bebutton
        width: 50; height: 50
    
        toCreateEntityType: "Block.qml"
    
        Rectangle {
            id: rectangle
            color: "yellow"
            anchors.fill: parent
        }
        
        // store the type you want to build somewhere, this can then be used to create an Entity with the EntityManager
        onClicked: {
          editorScene.selectedEntityType = toCreateEntityType
        }
    }

    Cheers,
    Alex

    #5979

    Martin

    Hey Alex,

    What you describe is exactly what I need. Could you add a clicked signal to the BEB in the next daily?

    Cheers, Martin

    #5980

    Alex
    Felgo Team

    Martin,

    I would do (nearly) everything for you! 😉

    Of course, it will be added to the next daily.

    Cheers,
    Alex

    #5981

    Martin

    Don’t tempt me to ask for more 😉

    Thanks, 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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded