Today I tried to get a gamepad that I have (a steelseries 3GC) to work with my Defold game. Because it is not a gamepad that is mapped in the default.gamepads file, I created a custom gamepads file and set my project file to use it.
When I try to bundle the game for Mac OS X and then run the bundled app, it starts quickly (to a black screen), then promptly quits. The game runs fine, and works great with my gamepad, when I simply do a standard Build and Launch.
How can I define a custom gamepad and still successfully create an OS X bundle?
Sure, I just threw it up on pastebin. The custom mapping is the second from the bottom. Although I am pretty sure this is a standard generic mapping, I am not sure if it is specific to this particular steelseries game controller (but I want to support this game controller natively since it is one of the few cheap ones out there that works with Mac right off-the-shelf).
Also, since we are on the topic, is there a way to specify D-pad mapping (a.k.a. hat switch mapping)? I currently can only tell that there is button mapping and axis mapping. You can see in the LPAD mappings that I just used the axis from the LSTICK, but this obviously takes away a couple usable buttons.
Edit: I just tested an HTML5 bundle as well, and it resulted in a completely black game canvas when I opened it in the browser. So the issue must not be limited to OS X bundles.
Hey! I think this is the same thing I actually ran into on Friday. I have a fix for it but I can’t promise it will make it to upcoming stable, otherwise it will land in the stable after that.
@sven, that’s great! I’ll look forward to the release where it is fixed.
Do you happen to have any idea how to map hat switches for the D-pad? It looks like the Playstation and Xbox controllers map them from normal buttons…but I can’t seem to find button indexes for the D-pad on this controller. From what I have seen, even every joystick mapping program handles hat switches a little different than normal buttons (as in, they get referred to as, for example, “East” and “West” instead of “Button 2” and “Button 3”)…which makes sense when you understand how a hat switch works.