コード例 #1
0
ファイル: Game1.cs プロジェクト: Xe3d/Main
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque);

            foreach (DrawablePhysicsObject crate in crateList)
            {
                crate.Draw(spriteBatch);
            }

            floor.Draw(spriteBatch);

            spriteBatch.End();

            floor.Draw(spriteBatch);
            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: Xe3d/Main
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);



            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, cam.get_transformation(GraphicsDevice));

            foreach (DrawablePhysicsObject crate in crateList)
            {
                crate.Draw(spriteBatch, Color.Red);
            }

            playerObj.Draw(spriteBatch, player.body.Rotation);
            floor.Draw(spriteBatch, Color.White);
            //        spriteBatch.Draw(floorTexture,new Rectangle((int)floor.Position.X, (int)floor.Position.Y, (int)floorSize.X, (int)floorSize.Y), Color.White);
            //      spriteBatch.Draw(floorTexture, platform.Position, Color.White);
            platform.Draw(spriteBatch, Color.White);
            //     Rectangle wallRect = new Rectangle((int)wall.Position.X, (int)wall.Position.Y, (int)wall.Size.X, (int)wall.Size.Y);
            //  spriteBatch.Draw(wall.texture, wallRect, null, Color.White, wall.body.Rotation, Vector2.Zero, SpriteEffects.None, 0);
            wall.Draw(spriteBatch, Color.White);
            Console.WriteLine(wall.body.Rotation);
            Console.WriteLine(crateList.Count);
            //        player.body.Draw(spriteBatch);

            particleEngine.Draw(spriteBatch);



            for (int index = 0; index < pList.Count; index++)
            {
                pList[index].Draw(spriteBatch);
            }



            spriteBatch.End();



            base.Draw(gameTime);
        }