public override void RenderImage(string uniqueId, IRectangle drawingGeometry, string caption, IImage image)
 {
     GUI.Label(
         drawingGeometry.ToRect(),
         image.ToTexture2D()
         );
 }
        public override void RenderLabel(string uniqueId, IRectangle drawingGeometry, string text, IStyle style, bool hasDropShadow,
                                         IRgbaColor dropShadowRgbaColor, float dropShadowOffsetX, float dropShadowOffsetY)
        {
            var styleToUse = (style ?? GetStyleByName("label")).ToGuiStyle();

            if (hasDropShadow)
            {
                var oldColor = GUI.color;
                GUI.color = dropShadowRgbaColor.ToColor();

                TempRect.Set(
                    drawingGeometry.X + dropShadowOffsetX,
                    drawingGeometry.Y + dropShadowOffsetY,
                    drawingGeometry.Width,
                    drawingGeometry.Height
                    );

                GUI.Label(
                    TempRect.ToRect(),
                    text,
                    styleToUse
                    );
                GUI.color = oldColor;
            }

            GUI.Label(
                drawingGeometry.ToRect(),
                text,
                styleToUse
                );
        }
 public override void RenderButton(string uniqueId, IRectangle drawingGeometry, string caption, IStyle style)
 {
     GUI.Button(
         drawingGeometry.ToRect(),
         caption,
         (style ?? GetStyleByName("button")).ToGuiStyle()
         );
 }
 public override IPoint BeginScrollView(string uniqueId, IRectangle drawingGeometry, IPoint scrollPosition, IRectangle contentRect)
 {
     return(GUI.BeginScrollView(
                drawingGeometry.ToRect(),
                scrollPosition.ToVector2(),
                contentRect.ToRect()
                ).ToPoint());
 }
 public override bool RenderImageToggleButton(string uniqueId, IRectangle drawingGeometry, bool isDown, IImage image, IStyle style)
 {
     return(GUI.Toggle(
                drawingGeometry.ToRect(),
                isDown,
                image.ToTexture2D(),
                (style ?? GetStyleByName("button")).ToGuiStyle()
                ));
 }
 public override bool RenderToggleButton(string uniqueId, IRectangle drawingGeometry, bool isDown, string caption, IStyle style)
 {
     return(GUI.Toggle(
                drawingGeometry.ToRect(),
                isDown,
                caption,
                (style ?? GetStyleByName("Button")).ToGuiStyle()
                ));
 }
        public override string RenderTextField(string uniqueId, bool enabled, IRectangle drawingGeometry, string content, IStyle style)
        {
            var oldEnabled = GUI.enabled;

            GUI.enabled = enabled;

            var newValue = GUI.TextField(
                drawingGeometry.ToRect(),
                content,
                (style ?? GetStyleByName("textfield")).ToGuiStyle()
                );

            GUI.enabled = oldEnabled;

            return(newValue);
        }
        public override float RenderVSlider(string uniqueId, bool enabled, IRectangle drawingGeometry, float value, float min, float max)
        {
            var oldEnabled = GUI.enabled;

            GUI.enabled = enabled;

            var newValue = GUI.VerticalSlider(
                drawingGeometry.ToRect(),
                value,
                min,
                max
                // TODO: StyleAdapter
                //                GuiStyle ?? GetStyleByName("verticalslider"),
                //                GuiStyle ?? GetStyleByName("verticalsliderthumb")
                );

            GUI.enabled = oldEnabled;

            return(newValue);
        }
        public override float RenderVScrollbar(string uniqueId, bool enabled, IRectangle drawingGeometry, float value, float size, float min,
                                               float max, IStyle style)
        {
            var oldEnabled = GUI.enabled;

            GUI.enabled = enabled;

            var newValue = GUI.VerticalScrollbar(
                drawingGeometry.ToRect(),
                value,
                size,
                min,
                max,
                (style ?? GetStyleByName("verticalscrollbar")).ToGuiStyle()
                );

            GUI.enabled = oldEnabled;

            return(newValue);
        }
 public override void BeginGroup(string uniqueId, IRectangle drawingGeometry)
 {
     GUI.BeginGroup(drawingGeometry.ToRect());
 }
 public override void RenderTexture(string uniqueId, IRectangle drawingGeometry, IImage texture)
 {
     GUI.DrawTexture(drawingGeometry.ToRect(), texture.ToTexture2D());
 }