当前位置: 首页>>代码示例>>C#>>正文


C# Buttons.ToString方法代码示例

本文整理汇总了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;
 }
开发者ID:bl2012,项目名称:teamugly,代码行数:7,代码来源:InputState.cs

示例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;
 }
开发者ID:thefkboss,项目名称:sabscripts,代码行数:10,代码来源:EventClient.cs

示例3: SendButton

 public bool SendButton(Buttons Button, string DeviceMap, ButtonFlagsType Flags, short Amount)
 {
     return SendButton(Button.ToString(), 0, DeviceMap, Flags, Amount);
 }
开发者ID:thefkboss,项目名称:sabscripts,代码行数:4,代码来源:EventClient.cs

示例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 }); }
        }
开发者ID:gabry90,项目名称:BIOXFramework,代码行数:13,代码来源:GamepadManager.cs

示例5: BindAction

 public void BindAction(string actionCode, Buttons button)
 {
     string keyCode = button.ToString();
     BindAction(actionCode, "Buttons", keyCode);
 }
开发者ID:DJSymBiotiX,项目名称:BType2,代码行数:5,代码来源:PlayerInput.cs

示例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);
     }
 }
开发者ID:Goatmancer,项目名称:Bullwhip-Platformer,代码行数:15,代码来源:Controls.cs

示例7: Button

 public Button(Buttons texturePath, Vector2 position, int width, int height)
     : base(texturePath.ToString(), position, width, height)
 {
     isPressed = false;
 }
开发者ID:titanXL,项目名称:SoftwareUniversity,代码行数:5,代码来源:Button.cs

示例8: GetButtonReleaseTime

 public static int GetButtonReleaseTime(Buttons b)
 {
     return instance.getButtonReleaseTime(b.ToString());
 }
开发者ID:RIT-Tool-Time,项目名称:Cascade,代码行数:4,代码来源:Controls.cs

示例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;
 }
开发者ID:Team-Dojo,项目名称:Dojo,代码行数:19,代码来源:State.cs

示例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);
 }
开发者ID:BenWoodford,项目名称:SteamWeb.NET,代码行数:6,代码来源:SteamWebClient.cs

示例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());
        }
开发者ID:AviiNL,项目名称:Ccs2DLcd,代码行数:69,代码来源:Program.cs


注:本文中的Buttons.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。