コード例 #1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            if (categoryChosen == true) //Ritar allt när man spelar ett ord
            {
                if (errors == maxErrors)
                {
                    spriteBatch.DrawString(TextureManager.font, strings[wordint], new Vector2(960, 190), Color.Black, 0, TextureManager.font.MeasureString(strings[wordint]) / 2, 1, SpriteEffects.None, 1);
                }

                spriteBatch.DrawString(TextureManager.fontStor, GetOutputString(), new Vector2(960, 100), Color.DarkSlateGray, 0, TextureManager.fontStor.MeasureString(GetOutputString()) / 2, 1, SpriteEffects.None, 1);
                touchKeyboard.Draw(spriteBatch);
                theHangman.Draw(spriteBatch);
                newWordButton.Draw(spriteBatch);
                spriteBatch.DrawString(TextureManager.font, "Kategori: " + categoryMenu.CategoryName(), new Vector2(1890, 70), Color.DarkSlateGray, 0, TextureManager.font.MeasureString("Kategori: " + categoryMenu.CategoryName()), 1, SpriteEffects.None, 1);

                //if-satser som visar vinst- eller förlorarskärm när man vunnit respektive förlorat
                if (GetOutputString() == strings[wordint])
                {
                    spriteBatch.Draw(TextureManager.winTex, new Vector2(960 - TextureManager.winTex.Width / 2, 565 - TextureManager.winTex.Height / 2), Color.White * 0.9f);
                }
                if (errors == maxErrors)
                {
                    spriteBatch.Draw(TextureManager.loseTex, new Vector2(960 - TextureManager.loseTex.Width / 2, 565 - TextureManager.loseTex.Height / 2), Color.White * 0.9f);
                }
            }
            else //Ritar kategorimenyn
            {
                categoryMenu.Draw(spriteBatch);
            }

            backButton.Draw(spriteBatch);
        }
コード例 #2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            touchKeyboard.Draw(spriteBatch);

            spriteBatch.DrawString(TextureManager.fontStor, GetOutputString(), new Vector2(960, 100), Color.DarkSlateGray, 0, TextureManager.fontStor.MeasureString(GetOutputString()) / 2, 1, SpriteEffects.None, 1);

            backButton.Draw(spriteBatch);
            saveButton.Draw(spriteBatch);
            eraseLastCharButton.Draw(spriteBatch);
            clearButton.Draw(spriteBatch);
            spaceButton.Draw(spriteBatch);
        }