Exemplo n.º 1
0
        // Appelé à chaque boucle graphique
        protected override void Draw()
        {
            base.Draw();

            spriteBatch.Begin();
            spriteBatch.Draw(background, new Vector2(0, 0), Color.White);
            spriteBatch.End();

            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera.Transform);
            cRend.Render(spriteBatch);

            // Robot  autonome
            spriteBatch.Draw(robot, new Vector2(iaVehicule.Position.X * 32 + 16, iaVehicule.Position.Y * 32 + 16),
                             new Rectangle(0, 0, robot.Width, robot.Height), Color.White, (((float)iaVehicule.ToOrientation) / 2) * (float)Math.PI,
                             new Vector2(robot.Width / 2, robot.Height / 2), 1.0f, SpriteEffects.None, 0);

            // Robot télécommandé
            if (window.RemoteEnabled)
            {
                spriteBatch.Draw(robot, new Vector2(remoteVehicule.Position.X * 32 + 16, remoteVehicule.Position.Y * 32 + 16),
                                 new Rectangle(0, 0, robot.Width, robot.Height), Color.White, (((float)remoteVehicule.ToOrientation) / 2) * (float)Math.PI,
                                 new Vector2(robot.Width / 2, robot.Height / 2), 1.0f, SpriteEffects.None, 0);
            }

            spriteBatch.End();
        }
Exemplo n.º 2
0
        // Appelé à chaque boucle graphique
        protected override void Draw()
        {
            base.Draw();

            spriteBatch.Begin();
            spriteBatch.Draw(background, new Vector2(0, 0), Color.White);
            spriteBatch.End();

            if (circuit != null && initialized)
            {
                spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, null, null, null, camera.Transform);
                cRend.Render(spriteBatch);
                spriteBatch.Draw(tOrigin, new Vector2(-16, -16), Color.White);
                cursor.DrawCursor(spriteBatch, camera);
                spriteBatch.End();
            }
        }