public Vector2 convertToVisualCoords(Vector2 coords, Explosion explosion) { //I made the offput just to always center the 1:1 ratio field even when widescreen float visualX = coords.X * sizeOfField - (explosion.frameWidth / 2) + offput.X; float visualY = coords.Y * sizeOfField - (explosion.frameHeight / 2) + offput.Y; return new Vector2(visualX, visualY); }
/// <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 texture = Content.Load<Texture2D>("explosion"); camera = new Camera(graphics.GraphicsDevice.Viewport); explosion = new Explosion(spriteBatch, texture, camera); // TODO: use this.Content to load your game content here }