コード例 #1
0
 public override void RenderImage(string uniqueId, IRectangle drawingGeometry, string caption, IImage image)
 {
     GUI.Label(
         drawingGeometry.ToRect(),
         image.ToTexture2D()
         );
 }
コード例 #2
0
        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
                );
        }
コード例 #3
0
 public override void RenderButton(string uniqueId, IRectangle drawingGeometry, string caption, IStyle style)
 {
     GUI.Button(
         drawingGeometry.ToRect(),
         caption,
         (style ?? GetStyleByName("button")).ToGuiStyle()
         );
 }
コード例 #4
0
 public override IPoint BeginScrollView(string uniqueId, IRectangle drawingGeometry, IPoint scrollPosition, IRectangle contentRect)
 {
     return(GUI.BeginScrollView(
                drawingGeometry.ToRect(),
                scrollPosition.ToVector2(),
                contentRect.ToRect()
                ).ToPoint());
 }
コード例 #5
0
 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()
                ));
 }
コード例 #6
0
 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()
                ));
 }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
 public override void BeginGroup(string uniqueId, IRectangle drawingGeometry)
 {
     GUI.BeginGroup(drawingGeometry.ToRect());
 }
コード例 #11
0
 public override void RenderTexture(string uniqueId, IRectangle drawingGeometry, IImage texture)
 {
     GUI.DrawTexture(drawingGeometry.ToRect(), texture.ToTexture2D());
 }