protected override void Draw(GuiRender render)
        {
            if (!Contain(Gui.Position))
            {
                active = false;
            }
            var colorGroup = Contain(Gui.Position) ? Style.Cover : Style.Color;
            var position   = new Point2f(
                (Size.Width - mTextBuffer.Size.Width) * 0.5f,
                (Size.Height - mTextBuffer.Size.Height) * 0.5f);

            if (active)
            {
                render.DrawImage(new Rectanglef(0, 0, Size.Width, Size.Height), this.Image);
                render.FillRectangle(
                    new Rectanglef(0, 0, Size.Width, Size.Height), new Colorf(0, 0, 1, 0.3f));
            }
            else
            {
                render.DrawImage(new Rectanglef(0, 0, Size.Width, Size.Height), this.Image);
                render.FillRectangle(new Rectanglef(0, 0, Size.Width, Size.Height),
                                     colorGroup.Background);
            }
            render.DrawText(position, mTextBuffer, colorGroup.Text);
        }
Exemple #2
0
 public void OnGUI(double deltaTime)
 {
     GuiRender?.Invoke(this, new GuiRenderEventArgs(this, deltaTime));
     foreach (IObject obj in _sceneObjects.Values)
     {
         if (obj is IGuiRenderable)
         {
             ((IGuiRenderable)obj).OnGUI(deltaTime);
         }
     }
 }
 protected override void Draw(GuiRender render)
 {
     if (State == StateToDraw.ButtonDown)
     {
         Draw_BD(render);
     }
     else
     {
         if (Contain(Gui.Position))
         {
             Draw_BH(render);
         }
         else
         {
             Draw_None(render);
         }
     }
 }
 private void Draw_None(GuiRender render)
 {
     render.FillRectangle(GuiCardRect.BHRect, Style.Color.Background);
     render.DrawImage(GuiCardRect.ImageRect, FrontImage, Style.ImageColor.Background);
 }
Exemple #5
0
 protected override void Draw(GuiRender render)
 {
     render.FillRectangle(backRect, backRectColor);
     render.DrawImage(picRect, mainPlaceImage, picRectColor);
     base.Draw(render);
 }
 protected override void Draw(GuiRender render)
 {
     render.FillRectangle(new Rectanglef(0, 0, Size.Width, Size.Height), new Colorf(1, 1, 0, 0.3f));
 }
 private void Draw_BH(GuiRender render)
 {
     render.FillRectangle(ContainerRect.BHRect, Style.Cover.Background);
     render.DrawImage(ContainerRect.ImageRect, CardImage, Style.ImageColor.Background);
 }