本文整理汇总了C#中InControl.InputDevice.AddAnalogControl方法的典型用法代码示例。如果您正苦于以下问题:C# InputDevice.AddAnalogControl方法的具体用法?C# InputDevice.AddAnalogControl怎么用?C# InputDevice.AddAnalogControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InControl.InputDevice
的用法示例。
在下文中一共展示了InputDevice.AddAnalogControl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VirtualControlInputDeviceManager
public VirtualControlInputDeviceManager()
{
device = new InputDevice( "VirtualControlInputDevice", 2, 2 );
device.AddAnalogControl( InputControlType.LeftStickX, "Virtual Stick" );
device.AddAnalogControl( InputControlType.LeftStickY, "Virtual Stick" );
device.AddButtonControl( InputControlType.Action1, "Virtual Button 1" );
device.AddButtonControl( InputControlType.Action2, "Virtual Button 2" );
InputManager.AttachDevice( device );
var virtualStick = new VirtualControlStick( InputControlType.LeftStickX, InputControlType.LeftStickY );
Node.AddChild( virtualStick );
virtualControls.Add( virtualStick );
var buttonPosition1 = new Vector2( Futile.screen.halfWidth - 128, -Futile.screen.halfHeight + 64 );
var virtualButton1 = new VirtualControlButton( InputControlType.Action1, "VirtualInput/ButtonA", buttonPosition1 );
Node.AddChild( virtualButton1 );
virtualControls.Add( virtualButton1 );
var buttonPosition2 = new Vector2( Futile.screen.halfWidth - 64, -Futile.screen.halfHeight + 128 );
var virtualButton2 = new VirtualControlButton( InputControlType.Action2, "VirtualInput/ButtonB", buttonPosition2 );
Node.AddChild( virtualButton2 );
virtualControls.Add( virtualButton2 );
Futile.touchManager.AddMultiTouchTarget( this );
}