Forums

OverviewV-Play 2 Support (Qt 5) › Fixture not working

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9115

    Bernd

    Hi!

    I am trying to use fixture: onBeginContact: {} to resolve collisions (collect power ups etc.)

    but I always get the message that “fixture doesn´t has members”.

     

    Since I get the same message while trying to run some of your demo games with the Qt Creator, I have no idea what the problem could be.

    #9116

    Christian
    V-Play Team

    Hi,

    can you post a sample code?

    Cheers, Chris

    #9117

    Bernd

    Sure, I am trying to do something like this:

     

        PowerUp{
            id: powerup
            x: 200
            y: 250
    
            BoxCollider {
              id:powerupCollider
              anchors.fill: powerup
              categories: Box.Category4
              collidesWith: Box.Category1
              collisionTestingOnlyMode: true
    
              fixture.onBeginContact: {
    
              }
            }
        }

     

    #9118

    Christian
    V-Play Team

    Can you post a test case with just a single QML file that works standalone please?

    Cheers, Chris

    #9119

    Bernd

    I hope that works for you:

     

    import VPlay 2.0
    import QtQuick 2.0
    
    GameWindow {
      id: gameWindow
    
        EntityManager {
            id: entityManager
            entityContainer: scene
        }
    
        PhysicsWorld {
          // set no gravity, the collider is not physics-based
        }
    
        Scene {
            id: scene
    
            EntityBase {
                entityId: "box1"
                entityType: "box"
    
                Image {
                    id: boxImage
                    source: "../assets/img/box.png"
                    width: 32
                    height: 32
                    anchors.fill: boxCollider
                }
    
                BoxCollider {
                    id: boxCollider
                    width: 32
                    height: 32
                    anchors.centerIn: parent
    
                    fixture.onBeginContact: {
                        // do stuff
                    }
                }
            }
        }
    }
    

     

    #9173

    Alex
    V-Play Team

    Hi,

    you can safely ignore that error message of the Qt Creator, it is just an issue with our auto completion files, it will still work when you run the code. This will be fixed with one of the next updates, thank you for reporting the issue.

    Cheers,
    Alex

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