Пример #1
0
        public override void Render()
        {
            if (drawColor != Color4.White)
            {
                _textboxLeft.Color  = drawColor.Convert();
                _textboxMain.Color  = drawColor.Convert();
                _textboxRight.Color = drawColor.Convert();
            }

            _textboxLeft.SetTransformToRect(_clientAreaLeft);
            _textboxMain.SetTransformToRect(_clientAreaMain);
            _textboxRight.SetTransformToRect(_clientAreaRight);
            _textboxLeft.Draw();
            _textboxMain.Draw();
            _textboxRight.Draw();

            if (Focus && blinkCount <= 0.25f)
            {
                CluwneLib.drawRectangle(Label.Position.X + _caretPos - _caretWidth, Label.Position.Y + (Label.Height / 2f) - (_caretHeight / 2f), _caretWidth, _caretHeight, new Color4(255, 255, 250, 255));
            }

            if (drawColor != Color4.White)
            {
                _textboxLeft.Color  = Color.White;
                _textboxMain.Color  = Color.White;
                _textboxRight.Color = Color.White;
            }

            Label.Color = textColor;
            Label.Text  = _displayText;
            Label.Draw();
        }
Пример #2
0
        /// <summary>
        /// Draws a Line to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Line </param>
        /// <param name="posY"> Pos Y of Line </param>
        /// <param name="rotate"> Line Rotation </param>
        /// <param name="thickness"> Line Thickness </param>
        /// <param name="Color"> Line Color </param>
        public static void drawLine(float posX, float posY, float length, float rotate, float thickness, Color4 Color)
        {
            RectangleShape line = new RectangleShape();

            line.Position         = new Vector2f(posX, posY);
            line.Size             = new Vector2f(length, thickness);
            line.Rotation         = rotate;
            line.OutlineThickness = thickness;
            line.FillColor        = Color.Convert();
            line.OutlineColor     = Color.Convert();

            CurrentRenderTarget.Draw(line);
        }
 public void Draw(Color4 Color)
 {
     _currentSprite.Scale = new SFML.System.Vector2f(HorizontalFlip ? -1 : 1, 1);
     _currentSprite.Color = Color.Convert();
     _currentSprite.Draw();
     _currentSprite.Color = Color4.White.Convert();
 }
Пример #4
0
        public override void Render()
        {
            _buttonLeft.Color  = drawColor.Convert();
            _buttonMain.Color  = drawColor.Convert();
            _buttonRight.Color = drawColor.Convert();

            _buttonLeft.SetTransformToRect(_clientAreaLeft);
            _buttonMain.SetTransformToRect(_clientAreaMain);
            _buttonRight.SetTransformToRect(_clientAreaRight);
            _buttonLeft.Draw();
            _buttonMain.Draw();
            _buttonRight.Draw();

            _buttonLeft.Color  = Color.White;
            _buttonMain.Color  = Color.White;
            _buttonRight.Color = Color.White;

            Label.Draw();
        }
Пример #5
0
        /// <summary>
        /// Draws text to the Current RenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of rectangle </param>
        /// <param name="posY"> Pos Y of rectangle </param>
        /// <param name="text"> Text to render </param>
        /// <param name="size"> Size of the font </param>
        /// <param name="textColor"> Color of the text </param>
        public static void drawText(float posX, float posY, string text, uint size, Color4 textColor, Font font)
        {
            Text _text = new Text(text, font);

            _text.Position      = new SFML.System.Vector2f(posX, posY);
            _text.FillColor     = textColor.Convert();
            _text.CharacterSize = size;

            CurrentRenderTarget.Draw(_text);
        }
Пример #6
0
        /// <summary>
        /// Draws a Filled Point to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Point </param>
        /// <param name="posY"> Pos Y of Point </param>
        /// <param name="color"> Fill Color </param>
        public static void drawPoint(int posX, int posY, Color4 color)
        {
            RectangleShape Point = new RectangleShape();

            Point.Position  = new Vector2f(posX, posY);
            Point.Size      = new Vector2f(1, 1);
            Point.FillColor = color.Convert();

            CurrentRenderTarget.Draw(Point);
        }
Пример #7
0
        /// <summary>
        /// Draws a Filled Circle to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Circle</param>
        /// <param name="posY"> Pos Y of Circle </param>
        /// <param name="radius"> Radius of Circle </param>
        /// <param name="color"> Fill Color </param>
        public static void drawCircle(int posX, int posY, int radius, Color4 color)
        {
            CircleShape Circle = new CircleShape();

            Circle.Position  = new Vector2f(posX, posY);
            Circle.Radius    = radius;
            Circle.FillColor = color.Convert();

            CurrentRenderTarget.Draw(Circle);
        }
Пример #8
0
        /// <summary>
        /// Draws a Rectangle to the current RenderTarget
        /// </summary>
        /// <param name="posX">Pos X of rectangle </param>
        /// <param name="posY"> Pos Y of rectangle </param>
        /// <param name="WidthX"> Width X of rectangle </param>
        /// <param name="HeightY"> Height Y of rectangle </param>
        /// <param name="Color"> Fill Color </param>
        public static void drawRectangle(float posX, float posY, float WidthX, float HeightY, Color4 Color)
        {
            RectangleShape rectangle = new RectangleShape();

            rectangle.Position  = new SFML.System.Vector2f(posX, posY);
            rectangle.Size      = new SFML.System.Vector2f(WidthX, HeightY);
            rectangle.FillColor = Color.Convert();

            CurrentRenderTarget.Draw(rectangle);
        }
Пример #9
0
        /// <summary>
        /// Draws a hollow Point to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Point </param>
        /// <param name="posY"> Pos Y of Point </param>
        /// <param name="OutlineColor"> Outline Color </param>
        public static void drawHollowPoint(int posX, int posY, Color4 OutlineColor)
        {
            RectangleShape hollowPoint = new RectangleShape();

            hollowPoint.Position         = new Vector2f(posX, posY);
            hollowPoint.Size             = new Vector2f(1, 1);
            hollowPoint.FillColor        = Color.Transparent;
            hollowPoint.OutlineThickness = .6f;
            hollowPoint.OutlineColor     = OutlineColor.Convert();

            CurrentRenderTarget.Draw(hollowPoint);
        }
Пример #10
0
        /// <summary>
        /// Draws a Hollow Circle to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Circle </param>
        /// <param name="posY"> Pos Y of Circle </param>
        /// <param name="radius"> Radius of Circle </param>
        /// <param name="OutlineThickness"> Thickness of Circle Outline </param>
        /// <param name="OutlineColor"> Circle outline Color </param>
        public static void drawHollowCircle(int posX, int posY, int radius, float OutlineThickness, Color4 OutlineColor)
        {
            CircleShape Circle = new CircleShape();

            Circle.Position         = new Vector2f(posX - radius, posY - radius);
            Circle.Radius           = radius;
            Circle.FillColor        = Color.Transparent;
            Circle.OutlineThickness = OutlineThickness;
            Circle.OutlineColor     = OutlineColor.Convert();

            CurrentRenderTarget.Draw(Circle);
        }
Пример #11
0
        /// <summary>
        /// Draws a Hollow Rectangle to the Current RenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of rectangle </param>
        /// <param name="posY"> Pos Y of rectangle </param>
        /// <param name="widthX"> Width X of rectangle </param>
        /// <param name="heightY"> Height Y of rectangle </param>
        /// <param name="OutlineThickness"> Outline Thickness of rectangle </param>
        /// <param name="OutlineColor"> Outline Color </param>
        public static void drawHollowRectangle(int posX, int posY, int widthX, int heightY, float OutlineThickness, Color4 OutlineColor)
        {
            RectangleShape HollowRect = new RectangleShape();

            HollowRect.FillColor        = Color.Transparent;
            HollowRect.Position         = new SFML.System.Vector2f(posX, posY);
            HollowRect.Size             = new SFML.System.Vector2f(widthX, heightY);
            HollowRect.OutlineThickness = OutlineThickness;
            HollowRect.OutlineColor     = OutlineColor.Convert();

            CurrentRenderTarget.Draw(HollowRect);
        }
Пример #12
0
 public static void ClearCurrentRendertarget(Color4 color)
 {
     CurrentRenderTarget.Clear(color.Convert());
 }