/// <summary> /// Copies TextImage to avoid Creating a new bitmap to save processing time /// </summary> /// <param name="num">Cuts out Desired Digit</param> /// <returns>returns new Copy object reference</returns> public TextImage Copy(int num) { TextImage p = new TextImage(gameWorld, num); p.spriteSheet = spriteSheet; p.Scale = Scale; return(p); }
/// <summary> /// GameWorld Constructor. Initializes and prepares various objects necessery for proper gameplay /// </summary> /// <param name="windowsize"></param> /// <param name="lang"></param> public GameWorld(Vector2 windowsize, string lang) { float width = windowsize.X; float height = windowsize.Y; windowSize = windowsize; language = lang; gameObjects = new List <GameObject>(); GameTimer = new Stopwatch(); explosionPrefab = new Explosion(this); pressStart = new TextImage(this, "Press"); pressStart.Position = new Vector2(width / 2, height / 2 + 64); pressStart.name = "Press"; pressStart.spriteSizeX = 275; pressStart.spriteSizeY = 47; pressStart.Scale = new Vector2(2, 2); pauseText = new TextImage(this, "Pause"); pauseText.Position = new Vector2(width / 2, height / 2 + 64); pauseText.name = "Pause"; pauseText.spriteSizeX = 65; pauseText.Scale = new Vector2(3, 3); pauseText.spriteSizeY = 16; realTimeScore = new TextImage(this, score, false); realTimeScore.name = "font_spreadsheet_x11x16.png"; realTimeScore.Scale = new Vector2(1, 1); realTimeScore.spriteSizeX = 11; realTimeScore.spriteSizeY = 16; realTimeScore.Position = new Vector2(width - 11, height - 16); rtScoreText = new TextImage(this, "Points"); rtScoreText.name = "Points"; rtScoreText.Scale = new Vector2(1, 1); rtScoreText.spriteSizeX = 71; rtScoreText.spriteSizeY = 16; rtScoreText.Position = new Vector2(width - 8 * 11 * realTimeScore.Scale.X - rtScoreText.spriteSizeX, height - 16); }