public override void Render()
        {
            if (disposing || !IsVisible())
            {
                return;
            }

            clippingRI.Clear(DrawBackground ? CluwneLib.SystemColorToSFML(BackgroundColor) : SFML.Graphics.Color.Transparent);
            clippingRI.BeginDrawing();

            foreach (GuiComponent component in components)
            {
                if (inner_focus != null && component == inner_focus)
                {
                    continue;
                }
                Point oldPos = component.Position;
                component.Position = new Point(component.Position.X - (int)scrollbarH.Value,
                                               component.Position.Y - (int)scrollbarV.Value);
                component.Update(0); //2 Updates per frame D:
                component.Render();
                if (CluwneLib.Debug.RenderingDelay > 0)
                {
                    clippingRI.EndDrawing();
                    clippingRI.Blit(Position, Color.White);
                    clippingRI.BeginDrawing();
                }
                component.Position = oldPos;
                component.Update(0);
            }

            if (inner_focus != null)
            {
                Point oldPos = inner_focus.Position;
                inner_focus.Position = new Point(inner_focus.Position.X - (int)scrollbarH.Value,
                                                 inner_focus.Position.Y - (int)scrollbarV.Value);
                inner_focus.Update(0); //2 Updates per frame D:
                inner_focus.Render();
                inner_focus.Position = oldPos;
                inner_focus.Update(0);
            }

            clippingRI.EndDrawing();
            clippingRI.Blit(Position, Color.White);
            // clippingRI.Blit(Position.X, Position.Y,clippingRI.Height, clippingRI.Width, Color.White, BlitterSizeMode.Crop);

            scrollbarH.Render();
            scrollbarV.Render();

            if (DrawBorder)
            {
                CluwneLib.drawHollowRectangle(ClientArea.X, ClientArea.Y, ClientArea.Width, ClientArea.Height,
                                              BorderSize, Color.Black);
            }
        }
Esempio n. 2
0
        public override void Render()
        {
            percent = (val - min) / (max - min);
            float barWidth = Size.X * percent;

            CluwneLib.drawRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height, backgroundColor);
            CluwneLib.drawHollowRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height, barWidth, barColor);
            CluwneLib.drawRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height, borderColor);

            Text.Draw();
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a TextSprite
        /// </summary>
        /// <param name="Label"> ID of the TextSprite</param>
        /// <param name="x"> position X of TextSprite </param>
        /// <param name="y"> Position Y of TextSprite </param>
        /// <param name="width"> Width of TextSprite </param>
        /// <param name="height"> Height of TextSprite </param>
//        public TextSprite(string Label, int x, int y, int width, int height)
//        {
//            this.Position = new Vector2(x, y);
//        }

        /// <summary>
        /// Draws the TextSprite to the CurrentRenderTarget
        /// </summary>
        ///
        #endregion

        #region Methods

        public void Draw()
        {
            _textSprite.Position = new Vector2f(Position.X, Position.Y); // -(_textSprite.GetLocalBounds().Height/2f));
            _textSprite.Color    = Color;
            CluwneLib.CurrentRenderTarget.Draw(_textSprite);

            if (CluwneLib.Debug.DebugTextboxes)//CluwneLib.Debug()
            {
                FloatRect fr = _textSprite.GetGlobalBounds();
                CluwneLib.drawHollowRectangle((int)fr.Left, (int)fr.Top, (int)fr.Width, (int)fr.Height, 1.0f, Color.Red);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Draws the TextSprite to the CurrentRenderTarget
        /// </summary>
        ///

        #endregion Constructors

        #region Methods

        public void Draw()
        {
            _textSprite.Position  = new Vector2f(Position.X, Position.Y);
            _textSprite.FillColor = Color.Convert();
            CluwneLib.CurrentRenderTarget.Draw(_textSprite);

            if (CluwneLib.Debug.DebugTextboxes)
            {
                var fr = _textSprite.GetGlobalBounds().Convert();
                CluwneLib.drawHollowRectangle((int)fr.Left, (int)fr.Top, (int)fr.Width, (int)fr.Height, 1.0f, Color4.Red);
            }
        }
Esempio n. 5
0
        public override void Render()
        {
            if (disposing || !IsVisible())
            {
                return;
            }

            clippingRI.Clear((DrawBackground ? BackgroundColor : Color4.Transparent).Convert());
            clippingRI.BeginDrawing();

            foreach (GuiComponent component in components)
            {
                if (inner_focus != null && component == inner_focus)
                {
                    continue;
                }
                var oldPos = component.Position;
                component.Position = new Vector2i(component.Position.X - (int)scrollbarH.Value,
                                                  component.Position.Y - (int)scrollbarV.Value);
                component.Update(0); //2 Updates per frame D:
                component.Render();

                component.Position = oldPos;
                component.Update(0);
            }

            if (inner_focus != null)
            {
                var oldPos = inner_focus.Position;
                inner_focus.Position = new Vector2i(inner_focus.Position.X - (int)scrollbarH.Value,
                                                    inner_focus.Position.Y - (int)scrollbarV.Value);
                inner_focus.Update(0); //2 Updates per frame D:
                inner_focus.Render();
                inner_focus.Position = oldPos;
                inner_focus.Update(0);
            }

            clippingRI.EndDrawing();
            clippingRI.Blit(Position.X, Position.Y, clippingRI.Height, clippingRI.Width, Color.White, BlitterSizeMode.None);

            scrollbarH.Render();
            scrollbarV.Render();

            if (DrawBorder)
            {
                CluwneLib.drawHollowRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height, BorderSize, Color4.Black);
            }
            clippingRI.EndDrawing();
        }
Esempio n. 6
0
        /// <summary>
        /// Creates a TextSprite
        /// </summary>
        /// <param name="Label"> ID of the TextSprite</param>
        /// <param name="x"> position X of TextSprite </param>
        /// <param name="y"> Position Y of TextSprite </param>
        /// <param name="width"> Width of TextSprite </param>
        /// <param name="height"> Height of TextSprite </param>
//        public TextSprite(string Label, int x, int y, int width, int height)
//        {
//            this.Position = new Vector2(x, y);
//        }

        /// <summary>
        /// Draws the TextSprite to the CurrentRenderTarget
        /// </summary>
        ///
        #endregion

        #region Methods
        public void Draw(RenderTarget target)
        {
            if (CluwneLib.Debug.Fontsize > 0)
            {
                _textSprite.CharacterSize = CluwneLib.Debug.Fontsize;
            }
            _textSprite.Position = new Vector2(Position.X, Position.Y); // -(_textSprite.GetLocalBounds().Height/2f));
            _textSprite.Color    = CluwneLib.SystemColorToSFML(Color);
            target.Draw(_textSprite);

            if (CluwneLib.Debug.TextBorders)
            {
                FloatRect fr = _textSprite.GetGlobalBounds();
                CluwneLib.drawHollowRectangle((int)fr.Left, (int)fr.Top, (int)fr.Width, (int)fr.Height, 1.0f, Color.Red);
            }
        }
Esempio n. 7
0
 public override void Render()
 {
     if (DrawBackground)
     {
         CluwneLib.drawRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height, BackgroundColor);
     }
     if (DrawTextHighlight)
     {
         CluwneLib.drawRectangle((int)(Text.Position.X + 3), (int)Text.Position.Y + 4, (int)Text.Width, (int)Text.Height - 9, BackgroundColor);
     }
     if (DrawBorder)
     {
         CluwneLib.drawHollowRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height, BorderWidth, BorderColor);
     }
     Text.Draw();
 }
Esempio n. 8
0
        /// <summary>
        /// Draws the TextSprite to the CurrentRenderTarget
        /// </summary>
        ///

        #endregion Constructors

        #region Methods

        public void Draw(IRenderTarget target, RenderStates states)
        {
            if (Shadowed)
            {
                var oldPos   = SFMLTextSprite.Position;
                var oldColor = SFMLTextSprite.FillColor;
                SFMLTextSprite.Position += ShadowOffset.Convert();
                SFMLTextSprite.FillColor = ShadowColor.Convert();
                SFMLTextSprite.Draw(target.SFMLTarget, states.SFMLRenderStates);
                SFMLTextSprite.Position  = oldPos;
                SFMLTextSprite.FillColor = oldColor;
            }
            SFMLTextSprite.Draw(target.SFMLTarget, states.SFMLRenderStates);

            if (CluwneLib.Debug.DebugTextboxes)
            {
                var fr = SFMLTextSprite.GetGlobalBounds().Convert();
                CluwneLib.drawHollowRectangle((int)fr.Left, (int)fr.Top, (int)fr.Width, (int)fr.Height, 1.0f, Color.Red);
            }
        }