public GameView(SpriteBatch sprite, Camera cam, Texture2D Smoke) { camera = cam; spriteBatch = sprite; smoke = Smoke; Vector2 startPosition = new Vector2(1.0f, 2.0f); smokeSystem = new SmokeSystem(startPosition); }
/// <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); // TODO: use this.Content to load your game content here Camera cam = new Camera(GraphicsDevice.Viewport); gameView = new GameView(spriteBatch, cam, Content.Load<Texture2D>("particlesmoke")); }
public void Draw(SpriteBatch sprite, Texture2D smokeTexture, Camera camera) { foreach (SmokeParticle particle in smokeArray) { sprite.Draw(smokeTexture, camera.getVisualCordinates(particle.Position), smokeTexture.Bounds, new Color(particle.Fade, particle.Fade, particle.Fade, particle.Fade), particle.Rotation, new Vector2(smokeTexture.Bounds.Width / 2, smokeTexture.Bounds.Height), particle.Size, SpriteEffects.None, 0); } }