WohlSoft / LunaLua

LunaLua - LunaDLL with Lua, is a free extension mod for SMBX 1.3 game engine, core of the X2 project.
https://codehaus.moe/
GNU General Public License v3.0
33 stars 12 forks source link

Function to get the state of a controller's stick #76

Closed MrDoubleA232 closed 2 months ago

MrDoubleA232 commented 3 months ago

Adds Misc.GetSelectedControllerStickPosition, returning two X/Y values, each within the range of -1 to 1 (though conversion to that range is done Lua-side).

Since I'm largely unfamiliar with how controller handling is done internally, it's possible that I've gone about this in a weird way. Let me know if there is some clear way of improving this.

MrDoubleA232 commented 3 months ago

Implemented the feedback: xAxis and yAxis are now integers, and getSelectedControllerStickX and getSelectedControllerStickY have been merged into getSelectedControllerStickPosition, returning a tuple.

Supermario1313 commented 3 months ago

Seems good to me.