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

Forums

OverviewFelgo 3 Support (Qt 5) › Bluetooth Joystick

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15546

    Rob

    Hi,

    I want to build a game where you can connect your mobile device

    to another via bluetooth.

    The device you connected to should become a “Joystick”

    (simple frame with 3 buttons). On clicking on one of the buttons

    a action should be performed on the device which started the connection

    and shows the game.

    I am not really sure if this is possible and in case it is possible how to tackle this

    problem.

    I already made a Screen which locates if there are any devices in proximity.

    (Right now using  Qt Bluetooth but it’s only limited to send strings? So I guess i have to use the

    C++ API?)

     

    Thank you

    Rob

    #15547

    Günther
    Felgo Team

    Hi Rob!

    This is possible from the Felgo side of things regarding the UI and logic of your game (though I never used Qt Bluetooth myself).

    You can add any kind of C++ feature in your game by Integrating C++ and QML, so you’re on the right track with Qt Bluetooth.
    How you set up the communication between the two devices then depends on your actual use-case.

    Even with only sending strings, you can easily define a simple protocol which message represents which action.
    Also, if you are thinking about the QML/Javascript side of things, you can also easily convert JSON data objects from and to string with the JSON.parse and JSON.stringify methods. So only being able to transfer strings is totally fine.

    Best,
    Günther

    #15606

    Rob

    Thanks Günther for the fast reply.

     

    What I still don’t understand is how one can display the sended image/string (in my case simple frame with 3 buttons)

    on the display of the device which the data was sended to.

     

    Thanks Rob

     

    #15608

    Günther
    Felgo Team

    As far as I understood, you want to use one application as your joystick and the other is the actual game.

    I don’t think that it is a good idea to send images / frames of what to display to the other device – why stream the images of the game if you can actually directly display the game, or did I misunderstand your idea?

    I believe it’s better to simply have 2 different screens in your app for the two devices:
    – ControllerScreen (is displayed on the device that connected to the another device)
    – GameScreen (is displayed on the device that is being controlled)
    Both screens are implemented in your app and the ControllerScreen is shown after you connected to second device.
    A touch event on the controller then does nothing except sending a command to the other device.
    The GameScreen on the other device then also includes some logic to listen to the actions sent by the controller.

    Best,
    Günther

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