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


C# IEntity.getManager方法代码示例

本文整理汇总了C#中IEntity.getManager方法的典型用法代码示例。如果您正苦于以下问题:C# IEntity.getManager方法的具体用法?C# IEntity.getManager怎么用?C# IEntity.getManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEntity的用法示例。


在下文中一共展示了IEntity.getManager方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: doBehaviour

        public override void doBehaviour(IEntity parent)
        {
            KeyboardState keyboardState = Keyboard.GetState(0);
            StringBuilder ds = new StringBuilder();

            if (keyboardState.GetPressedKeys().Contains(Keys.Q))
            {
                parent.getManager().game.IsFixedTimeStep = !parent.getManager().game.IsFixedTimeStep;
            }
            if (keyboardState.GetPressedKeys().Contains(Keys.W))
            {
                parent.getManager().game.graphics.SynchronizeWithVerticalRetrace = !parent.getManager().game.graphics.SynchronizeWithVerticalRetrace;
            }
            if (keyboardState.GetPressedKeys().Contains(Keys.F))
            {
                parent.getManager().game.graphics.ToggleFullScreen();
            }
            ds.Append("IsFixedTimeStep (Q to toggle): ");
            ds.Append(parent.getManager().game.IsFixedTimeStep);
            ds.AppendLine();
            ds.Append("ElapsedGameTime:");
            ds.Append(parent.getManager().game.gameTime.ElapsedGameTime);
            ds.AppendLine();
            ds.Append("TargetElapsedTime: ");
            ds.Append(parent.getManager().game.TargetElapsedTime);
            ds.AppendLine();
            ds.Append("SynchronizeWithVerticalRetrace (W to toggle): ");
            ds.Append(parent.getManager().game.graphics.SynchronizeWithVerticalRetrace);
            ds.AppendLine();
            ds.Append("Toggle fullscreen (F to toggle): ");

            parent.addAttribute("debugText", ds.ToString());
        }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:33,代码来源:DebugBehaviour.cs

示例2: doBehaviour

        public override void doBehaviour(IEntity parent)
        {
            Rectangle rectangle = parent.getAttribute<Rectangle>("boxRectangle");
            Color color = parent.getAttribute<Color>("boxColor");

            parent.getManager().game.spriteBatch.Draw(parent.getAttribute<Texture2D>("boxTexture"), rectangle, color);
        }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:7,代码来源:DrawFilledRectangleBehaviour.cs

示例3: doBehaviour

        public override void doBehaviour(IEntity parent)
        {
            string attributeToPulsate = parent.getAttribute<string>("attributeToPulsate");
            float attribute = parent.getAttribute<float>(attributeToPulsate);
            double time = parent.getManager().game.gameTime.TotalGameTime.TotalSeconds;

            float pulsate = (float)Math.Sin(time * 4);
            attribute = multiplier + pulsate * offset;
            parent.addAttribute(attributeToPulsate, attribute);
        }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:10,代码来源:PulsatingFloatBehaviour.cs

示例4: doBehaviour

        public override void doBehaviour(IEntity parent)
        {
            String text = parent.getAttribute<String>(textAttributeName+"Text");
            Color color = parent.getAttribute<Color>(textAttributeName+"Color");
            Vector2 position = parent.getAttribute<Vector2>(textAttributeName+"Position");
            float scale = parent.getAttribute<float>(textAttributeName + "Scale");
            float rotation = parent.getAttribute<float>(textAttributeName + "Rotation");

            //parent.getManager().game.spriteBatch.DrawString(font, text, position, color);
            Vector2 origin = font.MeasureString(text) / 2;
            position += origin;
            parent.getManager().game.spriteBatch.DrawString(font, text, position, color, rotation, origin, scale, SpriteEffects.None, 0);
        }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:13,代码来源:DrawTextBehaviour.cs

示例5: doBehaviour

        public override void doBehaviour(IEntity parent)
        {
            // probably not a good place to have Textures... They get big, and are copied here,
            // better have them stored somewhare for direct access.
            Texture2D texture = parent.getAttribute<Texture2D>("texture");
            Vector2 position = parent.getAttribute<Vector2>("position");
            float direction = parent.getAttribute<float>("direction");
            float scale = parent.getAttribute<float>("scale");

            Vector2 origin = new Vector2(texture.Width / 2, texture.Height - texture.Height / 3);

            parent.getManager().game.spriteBatch.Draw(texture, position, null, Color.White, direction, origin, scale, SpriteEffects.None, 0f);
        }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:13,代码来源:DrawTexture2DBehaviour.cs

示例6: doBehaviour

        public override void doBehaviour(IEntity parent)
        {
            GamePadState gamePadState = GamePad.GetState(0);
            KeyboardState keyboardState = Keyboard.GetState(0);
            // TODO: Generify!
            if (oldGamePadState.IsButtonDown(changeStatusButton) && gamePadState.IsButtonUp(changeStatusButton)
                || oldKeyboardState.IsKeyDown(changeStatusKey) && keyboardState.IsKeyUp(changeStatusKey))
            {
                parent.getManager().game.currentState = nextState;
            }

            oldKeyboardState = keyboardState;
            oldGamePadState = gamePadState;
        }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:14,代码来源:GameStateChangingBehaviour.cs

示例7: doBehaviour

 public override void doBehaviour(IEntity parent)
 {
     parent.getManager().game.GraphicsDevice.Clear(parent.getAttribute<Color>("color"));
 }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:4,代码来源:DrawBehaviour.cs

示例8: doBehaviour

 public override void doBehaviour(IEntity parent)
 {
     parent.getManager().game.Exit();
 }
开发者ID:TimeTourist,项目名称:mancomb,代码行数:4,代码来源:ExitGameBehaviour.cs


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