本文整理汇总了C#中Buttons.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Buttons.ToString方法的具体用法?C# Buttons.ToString怎么用?C# Buttons.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Buttons
的用法示例。
在下文中一共展示了Buttons.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetButtonName
public string GetButtonName(Buttons key)
{
if (buttonStates.ContainsKey(key))
return key.ToString();
else
return null;
}
示例2: SendSingleButton
public bool SendSingleButton(Buttons Button)
{
bool a = this.SendButton(Button.ToString(), "R1", XBMC.ButtonFlagsType.BTN_DOWN, 0);
if (a)
{
System.Threading.Thread.Sleep(100);
a = this.SendButton();
}
return a;
}
示例3: SendButton
public bool SendButton(Buttons Button, string DeviceMap, ButtonFlagsType Flags, short Amount)
{
return SendButton(Button.ToString(), 0, DeviceMap, Flags, Amount);
}
示例4: Register
public void Register(string mapName, Buttons? button, PlayerIndex player)
{
if (string.IsNullOrEmpty(mapName))
throw new GamepadManagerException("map name is null or empty!");
if (_maps.FirstOrDefault(x => string.Equals(x.Name, mapName)) != null)
throw new GamepadManagerException(string.Format("the map \"{0}\" is already registered!", mapName));
if (_maps.FirstOrDefault(x => x.Player == player && string.Equals(x.Button, button)) != null)
throw new GamepadManagerException(string.Format("the button \"{0}\" is already registered in \"{1}\" map for player \"{2}\"!", button.ToString(), mapName, player.ToString()));
lock (_maps) { _maps.Add(new GamepadMap { Name = mapName, Button = button, Player = player }); }
}
示例5: BindAction
public void BindAction(string actionCode, Buttons button)
{
string keyCode = button.ToString();
BindAction(actionCode, "Buttons", keyCode);
}
示例6: getButton
public int getButton(Buttons b)
{
if (controlMode == 0)
return -1;
int ind = Array.IndexOf(buttonString, b.ToString());
try
{
return buttonStateArray3[ind];
}
catch (IndexOutOfRangeException)
{
addButton(b);
return getButton(b);
}
}
示例7: Button
public Button(Buttons texturePath, Vector2 position, int width, int height)
: base(texturePath.ToString(), position, width, height)
{
isPressed = false;
}
示例8: GetButtonReleaseTime
public static int GetButtonReleaseTime(Buttons b)
{
return instance.getButtonReleaseTime(b.ToString());
}
示例9: Pressed
protected bool Pressed(Buttons button)
{
for (int i = 0; i < Global.MAX_PLAYERS; i++)
{
if (controller[i].IsConnected)
{
if (controller[i].IsButtonDown(button))
{
prevBtn[i] = button.ToString();
}
if (controller[i].IsButtonUp(button) && (prevBtn[i] == button.ToString()))
{
prevBtn[i] = null;
return true;
}
}
}
return false;
}
示例10: PressButton
public bool PressButton(Buttons button)
{
RestRequest request = GeneratePost("/steam/button/{button}/");
request.AddParameter("button", button.ToString().ToLower(), ParameterType.UrlSegment);
return (ProcessRequest(request).StatusCode == HttpStatusCode.Accepted);
}
示例11: engine_Update
static void engine_Update(object sender, Buttons buttons)
{
// Game logic
oldButtons = buttons;
player.Update(4, pStart, pEnd);
trimme.Update(1);
sphereLeft.Update(28, 32, 1);
sphereRight.Update(28);
oneup.Position.X += directionX * (float)Engine.ElapsedGameTime;
oneup.Position.Y += directionY * (float)Engine.ElapsedGameTime;
if (oneup.Position.X + oneup.Size.Width >= 320)
{
oneup.Position.X = 320 - oneup.Size.Width;
directionX = -((float)new Random().Next(1, 100)) / 100;
tiksound.Play();
pStart = 9;
pEnd = 12;
}
if (oneup.Position.X <= 0)
{
oneup.Position.X = 0;
directionX = ((float)new Random().Next(1, 100)) / 100;
tiksound.Play();
pStart = 5;
pEnd = 8;
}
if (oneup.Position.Y + oneup.Size.Height >= 240)
{
oneup.Position.Y = 240 - oneup.Size.Height;
directionY = -((float)new Random().Next(1, 100)) / 100;
tiksound.Play();
pStart = 1;
pEnd = 4;
}
if (oneup.Position.Y <= 0)
{
oneup.Position.Y = 0;
directionY = ((float)new Random().Next(1, 100)) / 100;
tiksound.Play();
pStart = 13;
pEnd = 16;
}
if (buttons == Buttons.Up)
player.Stop();
if (buttons == Buttons.Down)
player.Start();
if (buttons == Buttons.Menu)
{
sphereLeft.Stop(true);
sphereRight.Stop(true);
}
// Game Drawing
engine.screen.Clear();
sprites.ForEach(sprite => engine.screen.Draw(sprite));
engine.screen.DrawText("FPS: " + engine.FPS.ToString(), 230, 210);
engine.screen.DrawText("Buttons: " + buttons.ToString());
}