예제 #1
0
        public static void DrawPropaganda(Propaganda propaganda, SpriteBatch sp, GraphicsDeviceManager graphics, SpriteFont fonte)
        {
            int Largura = graphics.GraphicsDevice.Viewport.Width;
            int Altura  = graphics.GraphicsDevice.Viewport.Height;

            string    temp           = propaganda.Temporizador.ToString(@"ss");
            Rectangle rectPropaganda = new Rectangle((Largura / 2) - 250, (Altura / 2) - 250, 500, 500);
            Vector2   posTemp        = new Vector2(rectPropaganda.X + rectPropaganda.Width - 50, rectPropaganda.Y + 30);

            sp.Draw(propaganda.ImgPropaganda, rectPropaganda, Color.White);
            sp.DrawString(fonte, "!!! PROPAGANDA !!!", new Vector2(rectPropaganda.X + rectPropaganda.Width / 2 - 100, rectPropaganda.Y + rectPropaganda.Height / 2 - 25), Color.Black);
            sp.DrawString(fonte, temp, posTemp, Color.Black);

            propaganda.BotaoX.X = (int)posTemp.X - 25;
            propaganda.BotaoX.Y = (int)posTemp.Y - 10;

            if (propaganda.Temporizador < propaganda.FimTempo)
            {
                DrawObjetos.DrawBotao(propaganda.BotaoX, sp, propaganda.ImgBotao, fonte);
            }
        }
예제 #2
0
        public static void DrawAjuda(Ajuda ajuda, SpriteBatch sp, SpriteFont fonte, GraphicsDeviceManager graphics)
        {
            int Largura = graphics.GraphicsDevice.Viewport.Width;
            int Altura  = graphics.GraphicsDevice.Viewport.Height;

            //Fotos
            Rectangle[] rectPaginas;  //110 é o valor da largura da carta + 10
            rectPaginas = new Rectangle[ajuda.NumPaginas];
            rectPaginas[ajuda.PaginaAtual] = new Rectangle((Largura / 2) - 250, (Altura / 2) - 350, 500, 700);

            sp.Draw(ajuda.PaginasAjuda[ajuda.PaginaAtual], rectPaginas[ajuda.PaginaAtual], Color.White);

            //for (int i = 0; i < ajuda.NumPaginas; i++)
            //{
            //    rectPaginas[i] = new Rectangle((Largura / 2) - 250, (Altura / 2) - 350, 500, 700);
            //    sp.Draw(ajuda.PaginasAjuda[i], rectPaginas[i], Color.White);
            //}

            DrawObjetos.DrawBotao(ajuda.BotaoPagAnt, sp, ajuda.ImgBotao1, fonte);
            DrawObjetos.DrawBotao(ajuda.BotaoPagProx, sp, ajuda.ImgBotao, fonte);
        }