public GameView(SpriteBatch spriteBatch, Texture2D texture, Camera camera) { this.spriteBatch = spriteBatch; this.texture = texture; this.cam = camera; smokeSystem = new SmokeSystem(modelStartPosition); }
public void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture) { for (int i = 0; i < MAX_SMOKE; i++) { smokeClouds[i].Draw(spriteBatch, camera, texture); } }
/// <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); texture = Content.Load<Texture2D>("particlesmoke"); cam = new View.Camera(400, 400); view = new View.GameView(spriteBatch, texture, cam); // TODO: use this.Content to load your game content here }
internal void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture) { Vector2 viewPosition = camera.GetVisualPositions(position); Vector2 visualRadius = camera.GetVisualPositions(smokeSize); Rectangle rect = new Rectangle((int)viewPosition.X, (int)viewPosition.Y, (int)visualRadius.X, (int)visualRadius.Y); Color color = new Color(visibility, visibility, visibility, visibility); //spriteBatch.Draw(texture, rect, color); spriteBatch.Draw(texture, viewPosition, null, color, rotation, new Vector2(origin, origin), size, SpriteEffects.None, 0); }