joystick

Taking input from a joystick with C# .NET

大憨熊 提交于 2019-11-27 03:46:41
I searched around on Google for this, but the only things I came up with were outdated and did not work. Does anyone have any information on how to get joystick data using C# .NET? One: use SlimDX . Two: it looks something like this (where GamepadDevice is my own wrapper, and the code is slimmed down to just the relevant parts). Find the joystick / pad GUIDs: public virtual IList<GamepadDevice> Available() { IList<GamepadDevice> result = new List<GamepadDevice>(); DirectInput dinput = new DirectInput(); foreach (DeviceInstance di in dinput.GetDevices(DeviceClass.GameController,

Taking input from a joystick with C# .NET

不羁岁月 提交于 2019-11-26 10:52:31
问题 I searched around on Google for this, but the only things I came up with were outdated and did not work. Does anyone have any information on how to get joystick data using C# .NET? 回答1: One: use SlimDX. Two: it looks something like this (where GamepadDevice is my own wrapper, and the code is slimmed down to just the relevant parts). Find the joystick / pad GUIDs: public virtual IList<GamepadDevice> Available() { IList<GamepadDevice> result = new List<GamepadDevice>(); DirectInput dinput = new

Easy Touch Controls 组件运用

吃可爱长大的小学妹 提交于 2019-11-26 02:00:53
ETC(Easy Touch Controls)控件集中有两种类型的Joystick: Static(静态的):摇杆将会出现在你预先设定好的地方。 Dynamic(动态的):摇杆将会出现在你触碰到屏幕的地方。你也可以强制摇杆只出现在某个范围内。 每个摇杆控件由两个图片组成,一个作为背景,一个作为按键。摇杆控件的大小跟背景图片的大小相关(这个大小可以由宽度和高度参数设置)。摇杆控件每个轴(X和Y轴)返回参数大小范围为-1~1,也可以通过参数设置是否要打开对应的轴向。 (1)如何创建Joystick 选择EasyTouch Controls下的JoyStick。 ETC会自动创建一个canvas和一个EventSystem游戏对象。 (2)Joystick控件Inspector面板 属性组说明: Activated:是否激活这个摇杆控件,即使这个属性是disable状态摇杆控件也可见。 Visible:是否显示摇杆。 Use Fiexed Update:如果使用物理系统的更新频率的话需要勾选这个属性。 Position&Size:设置摇杆类型和位置、大小。 Axes properties:轴属性设置。 Sprites:设置摇杆的图片。 Move Events、Touch Events、Down Events、Press Events:在这四个事件面板中