• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Toolkit.GameTime类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SharpDX.Toolkit.GameTime的典型用法代码示例。如果您正苦于以下问题:C# GameTime类的具体用法?C# GameTime怎么用?C# GameTime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GameTime类属于SharpDX.Toolkit命名空间,在下文中一共展示了GameTime类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Draw

 public override void Draw(GameTime gametime)
 {
     game.GraphicsDevice.SetVertexBuffer(vertices);
     game.GraphicsDevice.SetVertexInputLayout(inputLayout);
     effect.CurrentTechnique.Passes[0].Apply();
     game.GraphicsDevice.Draw(PrimitiveType.TriangleList, vertices.ElementCount);
 }
开发者ID:reeselevine,项目名称:proj2,代码行数:7,代码来源:Ground.cs


示例2: PostUpdate

 public override void PostUpdate(GameTime gameTime)
 {
     if (parent != null)
     {
         parent.WorldBound = parent.WorldBound.Merge(this.WorldBound);
     }
 }
开发者ID:ukitake,项目名称:Stratum,代码行数:7,代码来源:SceneNode.cs


示例3: Update

        public void Update(GameTime gameTime)
        {
            if (Screens.Count > 0)
            {
                Screen foregroundScreen = Screens.Peek();
                List<Screen> Temp = Screens.ToList();
                foreach (Screen screen in Temp)
                {
                    if (screen.State == Screen.States.FullyClosed)
                    {
                        if (screen == foregroundScreen)
                            Screens.Pop();
                        else
                            continue;
                    }
                    screen.Update(gameTime, screen == foregroundScreen);
                }
            }

            if (toOpenWhenCleared != null && Screens.Count == 0)
            {
                OpenScreen(toOpenWhenCleared);
                toOpenWhenCleared = null;
            }
        }
开发者ID:BlaisePascalSi,项目名称:PokeSi,代码行数:25,代码来源:ScreenManager.cs


示例4: Draw

 public void Draw(GameTime gameTime)
 {
     foreach (var ctrl in Controls)
     {
         ctrl.Draw();
     }
 }
开发者ID:ImmortalJINX,项目名称:Project-EGOR,代码行数:7,代码来源:MasterWindow.cs


示例5: Draw

        protected override void Draw(GameTime gameTime)
        {
            // Use time in seconds directly
            var time = (float) gameTime.TotalGameTime.TotalSeconds;

            // Clears the screen with the Color.CornflowerBlue
            GraphicsDevice.Clear(Color.CornflowerBlue);
            GraphicsDevice.SetRasterizerState(_wireframe ? GraphicsDevice.RasterizerStates.WireFrame : GraphicsDevice.RasterizerStates.Default);

            _fx.Parameters["World"].SetValue(Matrix.Scaling(2.0f, 2.0f, 2.0f)*
                                             Matrix.RotationX(0.4f*(float) Math.Sin(time*1.45))*
                                             Matrix.RotationY(time*0.9f)*
                                             Matrix.Translation(-2, 0, -4));
            foreach (var effectPass in _fx.CurrentTechnique.Passes)
            {
                effectPass.Apply();

                GraphicsDevice.SetVertexBuffer(_vertexBuffer);
                GraphicsDevice.SetVertexInputLayout(_vertexInputLayout);

                GraphicsDevice.Draw(PrimitiveType.TriangleList, _vertexBuffer.ElementCount);
            }

            base.Draw(gameTime);
        }
开发者ID:danbystrom,项目名称:VisionQuest,代码行数:25,代码来源:DxExempel1.cs


示例6: Update

 public override void Update(Camera camera, GameTime gameTime)
 {
     base.Update(camera, gameTime);
     foreach (var item in Items)
         item.Age += (float) gameTime.ElapsedGameTime.TotalSeconds;
     Items.RemoveAll(_ => _.Age > _.TimeToLive);
 }
开发者ID:danbystrom,项目名称:VisionQuest,代码行数:7,代码来源:FloatingTexts.cs


示例7: Draw

 public void Draw(GameTime gameTime)
 {
     foreach (var o in Children.ToList())
     {
         o.Draw(gameTime);
     }
 }
开发者ID:nuclearpidgeon,项目名称:graphicsproj2,代码行数:7,代码来源:LevelPiece.cs


示例8: Update

 public override void Update(GameTime gameTime, int x, int y)
 {
     base.Update(gameTime, x, y);
     if (x != X || y != Y)
         throw new ArgumentException("Wrong coordinate");
     Update(gameTime);
 }
开发者ID:BlaisePascalSi,项目名称:PokeSi,代码行数:7,代码来源:LocatedTile.cs


示例9: Update

        public void Update(Camera camera, GameTime gameTime, ref IGameState gameState)
        {
            _turnAround ^= _serpents.Camera.KeyboardState.IsKeyPressed(Keys.Down);

            SerpentCamera.Move(gameTime);
            _serpents.Update(camera, gameTime);
            _serpents.UpdateScore();
            //camera.UpdateFreeFlyingCamera(gameTime);

            switch (_serpents.GameStatus())
            {
                case Serpents.Result.LevelComplete:
                    _delayAfterLevelComplete += (float) gameTime.ElapsedGameTime.TotalSeconds;
                    if (_delayAfterLevelComplete > 3)
                    {
                        _serpents.PlayerSerpent.DirectionTaker = null;
                        gameState = new LevelCompleteState(_serpents);
                    }
                    break;

                case Serpents.Result.PlayerDied:
                    _serpents.PlayerSerpent.DirectionTaker = null;
                    gameState = new DieState(_serpents);
                    break;
            }
        }
开发者ID:danbystrom,项目名称:VisionQuest,代码行数:26,代码来源:PlayingState.cs


示例10: Update

        public override void Update(GameTime gametime)
        {
            this.PhysicsDescription.ApplyImpulse(PhysicsSystem.toJVector(game.inputManager.SecondaryDirection() * 400f), PhysicsSystem.toJVector(Vector3.Zero));
            this.PhysicsDescription.ApplyImpulse(PhysicsSystem.toJVector(game.inputManager.Acceleration() * 400f), PhysicsSystem.toJVector(Vector3.Zero));

            base.Update(gametime);
        }
开发者ID:nuclearpidgeon,项目名称:graphicsproj2,代码行数:7,代码来源:Ball.cs


示例11: Draw

        public void Draw(GameTime gametime)
        {
            // Some objects such as the Enemy Controller have no model and thus will not be drawn
            if (model != null)
            {
                // Setup the vertices
                //game.GraphicsDevice.SetVertexBuffer(0, myModel.vertices, myModel.vertexStride);
                //game.GraphicsDevice.SetVertexInputLayout(myModel.inputLayout);

                // Apply the basic effect technique and draw the object
                basicEffect.CurrentTechnique.Passes[0].Apply();

                //game.GraphicsDevice.Draw(PrimitiveType.TriangleList, myModel.vertices.ElementCount);
                // Draw the model

                if (type != GameObjectType.Player)
                    model.Draw(game.GraphicsDevice, basicEffect.World, game.camera.View, game.camera.Projection);
                else
                    model.Draw(game.GraphicsDevice, basicEffect.World, Matrix.LookAtLH(Camera.originalPos, Camera.originalTarget, Camera.originalUp),
                        game.camera.Projection);
            }
            else if (texture != null)
            {
                Vector2 pos2D = new Vector2(pos.X, pos.Y);
                game.spriteBatch.Begin();
                game.spriteBatch.Draw(texture, pos2D, Color.White);
                game.spriteBatch.End();

            }
        }
开发者ID:okascout,项目名称:The-Empire-Strikes-Back,代码行数:30,代码来源:GameObject.cs


示例12: Draw

        /// <summary>
        /// Draws game content.
        /// </summary>
        /// <param name="gameTime">Structure containing information about elapsed game time.</param>
        protected override void Draw(GameTime gameTime)
        {
            // clear the scene to a CornflowerBlue color
            GraphicsDevice.Clear(Color.CornflowerBlue);

            base.Draw(gameTime);
        }
开发者ID:jjsnail,项目名称:SharpDXTutorial,代码行数:11,代码来源:MyGame.cs


示例13: Draw

 public void Draw(SpriteBatch _spriteBatch, GameTime gameTime)
 {
     foreach (Entity e in entities)
     {
         e.Render(_spriteBatch);
     }
 }
开发者ID:Baratock,项目名称:SynCLK,代码行数:7,代码来源:EntityManager.cs


示例14: Update

 public override void Update(Camera camera, GameTime gameTime)
 {
     _angle += (float) gameTime.ElapsedGameTime.TotalSeconds;
     if (_angle > MathUtil.TwoPi)
         _angle -= MathUtil.TwoPi;
     _animatedBone.Transform = Matrix.RotationZ(_angle)*_originalBoneTransformation;
 }
开发者ID:danbystrom,项目名称:VisionQuest,代码行数:7,代码来源:Windmill.cs


示例15: Draw

 public override void Draw(GameTime gameTime, SpriteBatch spriteBatch, int x, int y, Rectangle destinationRect)
 {
     base.Draw(gameTime, spriteBatch, x, y, destinationRect);
     if (x != X || y != Y)
         throw new ArgumentException("Wrong coordinate");
     Draw(gameTime, spriteBatch, destinationRect);
 }
开发者ID:BlaisePascalSi,项目名称:PokeSi,代码行数:7,代码来源:LocatedTile.cs


示例16: Draw

 public virtual void Draw(GameTime gameTime, bool isInForeground, SpriteBatch spriteBatch)
 {
     if (State == States.Opening)
         OpeningTransition.Update(gameTime);
     else if (State == States.Closing)
         ClosingTransition.Update(gameTime);
 }
开发者ID:BlaisePascalSi,项目名称:PokeSi,代码行数:7,代码来源:Screen.cs


示例17: Draw

        public override void Draw(GameTime gametime)
        {

            effect.Parameters["World"].SetValue(this.WorldMatrix);
            effect.Parameters["Projection"].SetValue(game.camera.projection);
            effect.Parameters["View"].SetValue(game.camera.view);
            effect.Parameters["cameraPos"].SetValue(game.camera.position);
            effect.Parameters["worldInvTrp"].SetValue(Matrix.Transpose(Matrix.Invert(this.WorldMatrix)));
            // For Rainbow (required)
            //effect.Parameters["Time"].SetValue((float)gametime.TotalGameTime.TotalSeconds);

            // For Cel (both optional)
            effect.Parameters["lightAmbCol"].SetValue<Color4>(Color.Lerp(Color.Red, Color.Blue, (float)Math.Abs((Math.Cos(2.0 * gametime.TotalGameTime.TotalSeconds)))));
            effect.Parameters["objectCol"].SetValue<Color4>(new Color4(0.5f, 0.5f, 0.5f, 1.0f));
            effect.Parameters["quant"].SetValue<float>(3.0f);

            //this.model.Draw(game.GraphicsDevice, this.worldMatrix, game.camera.view, game.camera.projection, effect);

            foreach (var pass in this.effect.CurrentTechnique.Passes)
            {
                pass.Apply();
                if (this.model != null)
                {
                    this.model.Draw(game.GraphicsDevice, WorldMatrix, game.camera.view, game.camera.projection, effect);
                }
            }
            if (PhysicsDescription.EnableDebugDraw && PersistentStateManager.debugRender && PhysicsDescription != null)
            {
                PhysicsDescription.DebugDraw(game.debugDrawer);
            }
        }
开发者ID:nuclearpidgeon,项目名称:graphicsproj2,代码行数:31,代码来源:Obelisk.cs


示例18: Update

 public void Update(GameTime gameTime)
 {
     foreach (var o in Children.ToList())
     {
         o.Update(gameTime);
     }
 }
开发者ID:nuclearpidgeon,项目名称:graphicsproj2,代码行数:7,代码来源:LevelPiece.cs


示例19: Update

 public override void Update(Camera camera, GameTime gameTime)
 {
     _shipModel.Update(camera, gameTime);
     _angle += gameTime.ElapsedGameTime.TotalSeconds / 100;
     _world = Matrix.Scaling(0.8f) * Matrix.RotationY(MathUtil.Pi) * Matrix.Translation(_radius, 1f, 0) * Matrix.RotationY((float)_angle);
     _shipModel.World = _world;
 }
开发者ID:danbystrom,项目名称:VisionQuest,代码行数:7,代码来源:MovingShip.cs


示例20: Update

 public override void Update(Camera camera, GameTime gameTime)
 {
     if (_delayBeforeStart <= 0)
         base.Update(camera, gameTime);
     else
         _delayBeforeStart -= (float) gameTime.ElapsedGameTime.TotalSeconds;
 }
开发者ID:danbystrom,项目名称:VisionQuest,代码行数:7,代码来源:EnemySerpent.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WIC.ImagingFactory类代码示例发布时间:2022-05-26
下一篇:
C# Toolkit.GameContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap