Exemplo n.º 1
0
        private static void DrawAnswerWindow(System.Object sender, Rage.GraphicsEventArgs e)
        {
            if (DisplayTime)
            {
                Rectangle drawRect   = new Rectangle(Game.Resolution.Width / 5, Game.Resolution.Height / 7, 700, 180);
                Rectangle drawBorder = new Rectangle(Game.Resolution.Width / 5 - 5, Game.Resolution.Height / 7 - 5, 700, 180);

                StringFormat stringFormat = new StringFormat();
                stringFormat.Alignment     = StringAlignment.Center;
                stringFormat.LineAlignment = StringAlignment.Center;

                e.Graphics.DrawRectangle(drawBorder, Color.FromArgb(90, Color.Black));
                e.Graphics.DrawRectangle(drawRect, Color.Black);

                e.Graphics.DrawText("Select with Number Keys", "Aharoni Bold", 18.0f, new PointF(drawBorder.X + 150, drawBorder.Y + 2), Color.White, drawBorder);

                int YIncreaser = 30;
                for (int i = 0; i < Answers.Count; i++)
                {
                    e.Graphics.DrawText("[" + (i + 1).ToString() + "] " + Answers[i], "Arial Bold", 15.0f, new PointF(drawRect.X + 10, drawRect.Y + YIncreaser), Color.White, drawRect);
                    YIncreaser += 25;
                }
            }
            else
            {
                Game.FrameRender -= DrawAnswerWindow;
            }
        }
Exemplo n.º 2
0
 private static void DrawImage(System.Object sender, Rage.GraphicsEventArgs e)
 {
     if (RadioShowing && DoneLoadingTextures)
     {
         e.Graphics.DrawTexture(RadioBackgroundTexture, new RectangleF(BaseX, BaseY, RadioBackgroundTextureWidth, RadioBackgroundTextureHeight));
         foreach (Button item in CurrentPage.Buttons)
         {
             if (item.CurrentTexture != null)
             {
                 e.Graphics.DrawTexture(item.CurrentTexture, item.TextureRectangle);
             }
         }
     }
 }
Exemplo n.º 3
0
 private static void DrawImage(System.Object sender, Rage.GraphicsEventArgs e)
 {
     if (UIShowing)
     {
         e.Graphics.DrawTexture(UIBackground, new RectangleF(BaseX, BaseY, UIBackground.Size.Width * ScaleFactor, UIBackground.Size.Height * ScaleFactor));
         foreach (UIButton button in AllUIButtons)
         {
             if (button.CurrentTexture != null && button.Enabled)
             {
                 e.Graphics.DrawTexture(button.CurrentTexture, new RectangleF(BaseX + button.XOffset * ScaleFactor, BaseY + button.YOffset * ScaleFactor, button.CurrentTexture.Size.Width * ScaleFactor, button.CurrentTexture.Size.Height * ScaleFactor));
             }
         }
     }
 }
Exemplo n.º 4
0
        private void DrawCCTVText(System.Object sender, Rage.GraphicsEventArgs e)
        {
            if (CCTVShowing)
            {
                Rectangle drawRect = new Rectangle(0, 0, 200, 130);
                e.Graphics.DrawRectangle(drawRect, Color.FromArgb(100, Color.Black));

                e.Graphics.DrawText("CCTV #" + CCTVCamNumber.ToString("00"), "Aharoni Bold", 35.0f, new PointF(1, 6), Color.White);
                e.Graphics.DrawText(DateTime.Now.Day.ToString("00") + "/" + DateTime.Now.Month.ToString("00") + "/" + DateTime.Now.Year.ToString(), "Aharoni Bold", 35.0f, new PointF(1, 46), Color.White, drawRect);
                e.Graphics.DrawText(DateTime.Now.Hour.ToString("00") + ":" + DateTime.Now.Minute.ToString("00") + ":" + DateTime.Now.Second.ToString("00"), "Aharoni Bold", 35.0f, new PointF(1, 86), Color.White, drawRect);
            }
            else
            {
                Game.FrameRender -= DrawCCTVText;
            }
        }
Exemplo n.º 5
0
        private void DrawPopup(System.Object sender, Rage.GraphicsEventArgs e)
        {
            if (isDisplaying)
            {
                Rectangle drawRect   = new Rectangle(Game.Resolution.Width / 4, Game.Resolution.Height / 7, 750, 200);
                Rectangle drawBorder = new Rectangle(Game.Resolution.Width / 4 - 5, Game.Resolution.Height / 7 - 5, 760, 210);
                e.Graphics.DrawRectangle(drawBorder, Color.FromArgb(90, Color.Black));
                e.Graphics.DrawRectangle(drawRect, Color.Black);

                e.Graphics.DrawText(PopupTitle, "Aharoni Bold", 18.0f, new PointF(drawBorder.X + 5, drawBorder.Y + 5), Color.White, drawBorder);
                double LineModifier = 0;
                foreach (string line in popupLines)
                {
                    e.Graphics.DrawText(line, "Arial Bold", 15.0f, new PointF(drawRect.X, (float)(drawRect.Y + 35 + LineModifier)), Color.White, drawRect);
                    LineModifier += PopupTextLineHeight + 2;
                }
            }
        }