public void Draw(Microsoft.Xna.Framework.GameTime gameTime, MyGraphicsClass graphics)
 {
     foreach (Vector2 obj in stars)
     {
         star.Draw(graphics, obj, 0);
     }
 }
Beispiel #2
0
 public void Draw(Microsoft.Xna.Framework.GameTime gameTime, MyGraphicsClass graphics)
 {
     foreach (Vector2 obj in stars)
     {
         star.Draw(graphics, obj, 0);
     }
 }
        public void Draw(MyGraphicsClass graphics, Vector2 position, float rotation)
        {
            graphics.getSpriteBatch().Draw(loadedTexture.Texture, position, null, color, rotation, origin, 1, SpriteEffects.None, depth);
            //graphics.getSpriteBatch().Draw(loadedTexture.Texture, position, null, color, 0, new Vector2(0), 1, SpriteEffects.None, depth);

            //graphics.DrawRectangle(loadedTexture.BoundingRectangle, position, Color.Red, 1);
            //graphics.DrawCircle(position + loadedTexture.BoundingCircle.Center, loadedTexture.BoundingCircle.Radius, Color.Red, 1);
        }
Beispiel #4
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            this.camera = new Camera(new Vector2(0), 1f, 0, this.graphics, inputManager);

            SpriteBatch spriteBatch = new SpriteBatch(GraphicsDevice);
            myGraphicsObject = new MyGraphicsClass(this.graphics, spriteBatch, this.camera);

            gameObjectCollection = new GameObjectCollection(worldSize);
        }
 public void DrawCompanySelection(GameTime gameTime, MyGraphicsClass myGraphicsClass, Company selectedCo)
 {
     int count = 0;
     foreach (Company co in this.companies.Value)
     {
         if (co != null)
         {
             Vector2 textSize = MyGraphicsClass.Font.MeasureString(co.GetHudText());
             if (co == selectedCo)
             {
                 myGraphicsClass.DrawRectangle(new Vector2(0, count), textSize, new Vector2(0), 0, Color.Red, 1);
                 myGraphicsClass.DrawDebugFont("X", new Vector2(textSize.X + 5, count), 1);
             }
             count = count + (int)(textSize.Y);
         }
     }
 }
 public virtual void Draw(GameTime gameTime, MyGraphicsClass graphics) { }
Beispiel #7
0
 public void Draw(MyGraphicsClass graphics, Vector2 position, float rotation)
 {
     graphics.getSpriteBatch().Draw(loadedTexture.Texture, position, null, color, rotation, origin, 1, SpriteEffects.None, depth);
 }
 public override void Draw(GameTime gameTime, MyGraphicsClass graphics)
 {
     base.Draw(gameTime, graphics);
     collidable.Position = this.Position;
     collidable.Rotation = this.Direction;
     collidable.Draw(graphics);
 }
Beispiel #9
0
 public void Draw(MyGraphicsClass graphics, Vector2 pos)
 {
     if (this.Contains(pos))
     {
         Draw(graphics, Color.Red, 1);
     }
     else
     {
         Draw(graphics, Color.Blue, 1);
     }
 }
Beispiel #10
0
 public override void Draw(GameTime gameTime, MyGraphicsClass graphics)
 {
     if (controllingPlayer.Value == null)
     {
         this.Collidable.Draw(graphics, this.Position, this.Direction);
     }
     else
     {
         this.Collidable.Draw(graphics, this.Position, this.Direction, controllingPlayer.Value.Color);
     }
     graphics.DrawDebugFont(this.materiel.Value.ToString(), this.Position + new Vector2(25, 0), 1f);
 }
Beispiel #11
0
 public override void Draw(GameTime gameTime, MyGraphicsClass graphics)
 {
     base.Draw(gameTime, graphics);
 }
Beispiel #12
0
 public override void Draw(GameTime gameTime, MyGraphicsClass graphics)
 {
     base.Draw(gameTime, graphics);
     graphics.DrawDebugFont("T", this.Position + new Vector2(25, 15), 1f);
 }
 public override void Draw(Microsoft.Xna.Framework.GameTime gameTime, MyGraphicsClass graphics)
 {
     base.Draw(gameTime, graphics);
     this.Collidable.Draw(graphics, this.Position, this.Direction);
 }
 public void DrawCompanyList(GameTime gameTime, MyGraphicsClass myGraphicsClass, Camera camera)
 {
     int count = 0;
     foreach (Company co in this.companies.Value)
     {
         if (co != null)
         {
             Vector2 textSize = MyGraphicsClass.Font.MeasureString(co.GetHudText());
             myGraphicsClass.DrawDebugFont(co.GetHudText(), new Vector2(0, count), 1);
             count = count + (int)(textSize.Y);
             co.DrawScreen(gameTime, myGraphicsClass, camera, Color.Gray, .9f);
         }
     }
 }
 public static void Initialize(MyGraphicsClass graphics, InputManager inputManager, Camera camera)
 {
     Vector2 screenSize = new Vector2(graphics.getGraphics().PreferredBackBufferWidth, graphics.getGraphics().PreferredBackBufferHeight);
     GunnerController.inputManager = inputManager;
     GunnerController.camera = camera;
     screen = new Utils.RectangleF(new Vector2(0), screenSize);
 }
 public void Draw(GameTime gameTime, MyGraphicsClass graphics)
 {
     //throw new NotImplementedException();
     graphics.getSpriteBatch().Draw(Textures.AimPoint, aimPoint, null, color, 0, new Vector2((float)(Textures.AimPoint.Width / 2.0)), 1, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 1);
 }
 public void Draw(MyGraphicsClass graphics)
 {
     graphics.getSpriteBatch().Draw(texture, position, null, color, rotation, origin, 1, SpriteEffects.None, depth);
     /*Rectangle bound = this.BoundingRectangle();
     graphics.DrawRectangle(new Vector2(bound.X, bound.Y), new Vector2(bound.Width, bound.Height), new Vector2(0), 0, Color.Black, 1);*/
 }
Beispiel #18
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.

            spriteBatch = new SpriteBatch(GraphicsDevice);
            Texture2D line = Content.Load<Texture2D>("line");
            camera = new Camera(new Vector2(0), .25f, 0, graphics);
            myGraphicsObject = new DrawingUtils.MyGraphicsClass(graphics, spriteBatch, camera);
            DrawingUtils.MyGraphicsClass.LoadContent(Content);
            Textures.LoadContent(Content);
            // TODO: use this.Content to load your game content here
        }
 public void Draw(GameTime gameTime, MyGraphicsClass graphics)
 {
     graphics.BeginWorld();
     foreach (GameObject obj in listManager.GetList<GameObject>())
     {
         obj.Draw(gameTime, graphics);
     }
     graphics.EndWorld();
 }
Beispiel #20
0
 public void Draw(MyGraphicsClass graphics, Color color, float depth)
 {
     graphics.DrawLine(point1, point2, color, depth);
     graphics.DrawLine(point1, point3, color, depth);
     graphics.DrawLine(point3, point2, color, depth);
 }
        public void Draw(GameTime gameTime, MyGraphicsClass graphics)
        {
            //graphics.DrawRectangle(worldRectangle.Position, worldRectangle.Size, new Vector2(0), 0, Color.Red, 1);
            foreach (GameObject obj in gameObjects)
            {
                obj.Draw(gameTime, graphics);
            }
            foreach (Drawable obj in stars)
            {
                obj.Draw(graphics);
            }

            foreach (GameObject obj in spacialData.CompleteList())
            {
                obj.Draw(gameTime, graphics);
            }
        }
 public void Draw(MyGraphicsClass graphics, Vector2 position, float rotation)
 {
     graphics.getSpriteBatch().Draw(loadedTexture.Texture, position, null, color, rotation, origin, 1, SpriteEffects.None, depth);
 }
Beispiel #23
0
 public override void Draw(GameTime gameTime, MyGraphicsClass graphics)
 {
     drawable.Position = this.WorldPosition();
     drawable.Rotation = this.WorldDirection();
     drawable.Draw(graphics);
 }
Beispiel #24
0
 public virtual void DrawScreen(GameTime gameTime, MyGraphicsClass graphics) 
 {
     if (this.nextInStack != null)
     {
         this.nextInStack.DrawScreen(gameTime, graphics);
     }
 }
Beispiel #25
0
        public override void Draw(GameTime gameTime, MyGraphicsClass graphics)
        {
            collidable.Draw(graphics);

        }
 public override void Draw(GameTime gameTime, MyGraphicsClass graphics)
 {
     base.Draw(gameTime, graphics);
     Vector2 pos = this.WorldPosition();
     float dr = this.WorldDirection();
     collidable.Draw(graphics, pos, dr);
 }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            this.camera = new Camera(new Vector2(0), 1f, 0, this.graphics);

            SpriteBatch spriteBatch = new SpriteBatch(GraphicsDevice);
            myGraphicsObject = new DrawingUtils.MyGraphicsClass(this.graphics, spriteBatch, this.camera);

            backGround = new BackGround(worldSize);
            gameObjectCollection = new GameObjectCollection(worldSize);
        }