當前位置: 首頁>>代碼示例>>C#>>正文


C# Toolkit.GameTime類代碼示例

本文整理匯總了C#中SharpDX.Toolkit.GameTime的典型用法代碼示例。如果您正苦於以下問題:C# GameTime類的具體用法?C# GameTime怎麽用?C# GameTime使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GameTime類屬於SharpDX.Toolkit命名空間,在下文中一共展示了GameTime類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的SharpDX.Toolkit.GameTime類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。