Ejemplo n.º 1
0
        public override void Render()
        {
            if (drawColor != Color.White)
            {
                _textboxLeft.Color  = drawColor;
                _textboxMain.Color  = drawColor;
                _textboxRight.Color = drawColor;
            }

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

            if (Focus && blinkCount <= 0.25f)
            {
                Gorgon.CurrentRenderTarget.FilledRectangle(_caretPos - _caretWidth,
                                                           Label.Position.Y + (Label.Height / 2f) - (_caretHeight / 2f),
                                                           _caretWidth, _caretHeight, Color.WhiteSmoke);
            }

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

            Label.Color = textColor;
            Label.Text  = _displayText;
            Label.Draw();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
0
        public override void Render()
        {
            if (drawColor != Color.White)
            {
                _textboxLeft.Color  = CluwneLib.SystemColorToSFML(drawColor);
                _textboxMain.Color  = CluwneLib.SystemColorToSFML(drawColor);
                _textboxRight.Color = CluwneLib.SystemColorToSFML(drawColor);
            }

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

            if (Focus && blinkCount <= 0.25f)
            {
                //Draw Textbox

                // CluwneLib.CurrentRenderTarget.Draw(_caretPos - _caretWidth, Label.Position.Y + (Label.Height/2f) - (_caretHeight/2f),_caretWidth, _caretHeight, new Color(255,255,250));

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

            Label.Color = textColor;
            Label.Text  = _displayText;
            Label.Draw();
        }
Ejemplo n.º 4
0
        public void DrawTooltip() //Has to be separate so it draws on top of all buttons.
        {
            if (showTooltip)
            {
                string leftStr = Math.Truncate(assignedEffect.expiresAt.Subtract(DateTime.Now).TotalSeconds).ToString();

                string tooltipStr = assignedEffect.name +
                                    (assignedEffect.family != StatusEffectFamily.None
                                         ? Environment.NewLine + "(" + assignedEffect.family.ToString() + ")"
                                         : "") + Environment.NewLine + Environment.NewLine +
                                    assignedEffect.description +
                                    (assignedEffect.doesExpire
                                         ? Environment.NewLine + Environment.NewLine + leftStr + " sec"
                                         : "");

                tooltip.Text = tooltipStr;
                var x_pos = (tooltipPos.X + 10 + tooltip.Width + 5) > CluwneLib.CurrentClippingViewport.Width
                                  ? 0 - tooltip.Width - 10
                                  : 10 + 5;
                tooltip.Position = new Vector2i(tooltipPos.X + x_pos + 5, tooltipPos.Y + 5 + 10);
                CluwneLib.drawRectangle(tooltipPos.X + x_pos, tooltipPos.Y + 10, tooltip.Width + 5,
                                        tooltip.Height + 5, new Color(70, 130, 180));
                CluwneLib.drawRectangle(tooltipPos.X + x_pos, tooltipPos.Y + 10, tooltip.Width + 5,
                                        tooltip.Height + 5, new Color(72, 61, 139));
                tooltip.Draw();
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Handles the OnFrameBegin event of the Screen control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="FrameEventArgs"/> instance containing the event data.</param>
 private void Screen_OnFrameBegin(object sender, FrameEventArgs e)
 {
     // Clear the screen.
     Gorgon.Screen.Clear();
     txtspr.Draw();
     Gorgon.Screen.Rectangle(0, 0, txtspr.Size.X, txtspr.Size.Y, Color.Brown);
 }
Ejemplo n.º 6
0
 private void DrawString(int x, int y, string str)
 {
     _textSprite.Text      = str;
     _textSprite.Position  = new Vector2(x + _scrOffX, y + _scrOffY);
     _textSprite.FillColor = Color.DarkSlateBlue;
     _textSprite.Draw();
 }
Ejemplo n.º 7
0
        public void DrawTooltip() //Has to be separate so it draws on top of all buttons.
        {
            if (showTooltip)
            {
                string leftStr = Math.Truncate(assignedEffect.expiresAt.Subtract(DateTime.Now).TotalSeconds).ToString();

                string tooltipStr = assignedEffect.name +
                                    (assignedEffect.family != StatusEffectFamily.None
                                         ? Environment.NewLine + "(" + assignedEffect.family.ToString() + ")"
                                         : "") + Environment.NewLine + Environment.NewLine +
                                    assignedEffect.description +
                                    (assignedEffect.doesExpire
                                         ? Environment.NewLine + Environment.NewLine + leftStr + " sec"
                                         : "");

                tooltip.Text = tooltipStr;
                float x_pos = (tooltipPos.X + 10 + tooltip.Width + 5) > Gorgon.CurrentClippingViewport.Width
                                  ? 0 - tooltip.Width - 10
                                  : 10 + 5;
                tooltip.Position = new Vector2D(tooltipPos.X + x_pos + 5, tooltipPos.Y + 5 + 10);
                Gorgon.CurrentRenderTarget.FilledRectangle(tooltipPos.X + x_pos, tooltipPos.Y + 10, tooltip.Width + 5,
                                                           tooltip.Height + 5, Color.SteelBlue);
                Gorgon.CurrentRenderTarget.Rectangle(tooltipPos.X + x_pos, tooltipPos.Y + 10, tooltip.Width + 5,
                                                     tooltip.Height + 5, Color.DarkSlateBlue);
                tooltip.Draw();
            }
        }
Ejemplo n.º 8
0
 public override void Draw(SpriteBatch spriteBatch, BaseSprite viewport)
 {
     base.Draw(spriteBatch, viewport);
     m_index.Draw(spriteBatch, viewport);
     m_desc.Draw(spriteBatch, viewport);
     m_difficultBack.Draw(spriteBatch, viewport);
 }
Ejemplo n.º 9
0
        private void DrawBubbleSprite()
        {
            RenderTarget originalTarget = Gorgon.CurrentRenderTarget;
            Sprite       cornerSprite   = _resourceManager.GetSprite("corners");

            //Set up dimensions
            _bubbleRender.SetDimensions((int)_textSprite.Size.X + 10, (int)_textSprite.Size.Y + 10);
            _bubbleSprite.SetSize(_textSprite.Size.X + 10, _textSprite.Size.Y + 10);

            //BEGIN RENDERING
            Gorgon.CurrentRenderTarget = _bubbleRender;
            _bubbleRender.Clear(Color.Transparent);

            //Draw black triangle at the bottom.
            var pointOneBlack   = new Vector2D((_bubbleRender.Width / 2) - 10, _bubbleRender.Height - 10);
            var pointTwoBlack   = new Vector2D((_bubbleRender.Width / 2) + 10, _bubbleRender.Height - 10);
            var pointThreeBlack = new Vector2D((_bubbleRender.Width / 2), _bubbleRender.Height);

            _bubbleRender.FilledTriangle(pointOneBlack, pointTwoBlack, pointThreeBlack, Color.Black);

            //Draw the side lines
            _bubbleRender.Line(10, 0, _bubbleRender.Width - 20, 1, Color.Black);
            _bubbleRender.Line(_bubbleRender.Width - 1, 10, 1, _bubbleRender.Height - 26, Color.Black);
            _bubbleRender.Line(10, _bubbleRender.Height - 7, _bubbleRender.Width - 20, 1, Color.Black);
            _bubbleRender.Line(0, 10, 1, _bubbleRender.Height - 26, Color.Black);

            //Fill in the middle without polluting the corners.
            _bubbleRender.FilledRectangle(3, 1, _bubbleRender.Width - 6, _bubbleRender.Height - 8, Color.White);
            _bubbleRender.FilledRectangle(1, 3, _bubbleRender.Width - 2, _bubbleRender.Height - 12, Color.White);

            //Draw the white triangle at the bottom.
            Vector2D pointOneWhite   = pointOneBlack + new Vector2D(1, 0);
            Vector2D pointTwoWhite   = pointTwoBlack - new Vector2D(1, 0);
            Vector2D pointThreeWhite = pointThreeBlack - new Vector2D(0, 1);

            _bubbleRender.FilledTriangle(pointOneWhite, pointTwoWhite, pointThreeWhite, Color.White);

            //Draw the corners.
            cornerSprite.SourceBlend      = AlphaBlendOperation.One;
            cornerSprite.DestinationBlend = AlphaBlendOperation.Zero;
            cornerSprite.VerticalFlip     = true;
            cornerSprite.SetPosition(0, 0);
            cornerSprite.Draw();
            cornerSprite.HorizontalFlip = true;
            cornerSprite.SetPosition(_bubbleRender.Width - 16, 0);
            cornerSprite.Draw();
            cornerSprite.VerticalFlip = false;
            cornerSprite.SetPosition(_bubbleRender.Width - 16, _bubbleRender.Height - 22);
            cornerSprite.Draw();
            cornerSprite.HorizontalFlip = false;
            cornerSprite.SetPosition(0, _bubbleRender.Height - 22);
            cornerSprite.Draw();

            _textSprite.Draw();

            Gorgon.CurrentRenderTarget = originalTarget;

            _buildTime = DateTime.Now;
        }
Ejemplo n.º 10
0
 public override void Render()
 {
     _dropDown.Render();
     _listboxLeft.Draw(_clientAreaLeft);
     _listboxMain.Draw(_clientAreaMain);
     _listboxRight.Draw(_clientAreaRight);
     _selectedLabel.Draw();
 }
        public override void Render()
        {
            CluwneLib.drawRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height,
                                    selected ? new Color4(34, 139, 34, 255) : new Color4(255, 250, 240, 255));

            objectSprite.Draw();
            name.Draw();
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Прорисовка полхунка в текущем кадре
 /// </summary>
 public override void Draw(SpriteBatch spriteBatch)
 {
     if (Visible)
     {
         base.Draw(spriteBatch);
         image_.Draw(spriteBatch);
         text.Draw(spriteBatch);
     }
 }
Ejemplo n.º 13
0
 public override void Render()
 {
     CluwneLib.drawRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height,
                             selected ? new SFML.Graphics.Color(34, 139, 34) : new SFML.Graphics.Color(255, 250, 240));
     CluwneLib.drawRectangle(ClientArea.Left, ClientArea.Top, ClientArea.Width, ClientArea.Height,
                             Color.Black);
     objectSprite.Draw();
     name.Draw();
 }
Ejemplo n.º 14
0
 public override void Render()
 {
     CluwneLib.drawRectangle(ClientArea.X, ClientArea.Y, ClientArea.Width, ClientArea.Height,
                             selected ? Color.ForestGreen : Color.FloralWhite);
     CluwneLib.drawRectangle(ClientArea.X, ClientArea.Y, ClientArea.Width, ClientArea.Height,
                             Color.Black);
     objectSprite.Draw();
     name.Draw();
 }
        public override void Draw()
        {
            BackgroundColor = Selected ? new Color(34, 139, 34) : new Color(255, 250, 240);

            base.Draw();

            _sprite.Draw();
            _name.Draw();
        }
 public override void Render()
 {
     Gorgon.CurrentRenderTarget.FilledRectangle(ClientArea.X, ClientArea.Y, ClientArea.Width, ClientArea.Height,
                                                selected ? Color.ForestGreen : Color.FloralWhite);
     Gorgon.CurrentRenderTarget.Rectangle(ClientArea.X, ClientArea.Y, ClientArea.Width, ClientArea.Height,
                                          Color.Black);
     objectSprite.Draw();
     name.Draw();
 }
Ejemplo n.º 17
0
 public override void Render()
 {
     if (_bgcol != Color.Transparent)
     {
         CluwneLib.drawRectangle(ClientArea.X, ClientArea.Y, ClientArea.Width,
                                 ClientArea.Height, _bgcol);
     }
     _icon.Draw();
     Label.Draw();
 }
Ejemplo n.º 18
0
 public override void Draw(SpriteBatch spriteBatch)
 {
     if (Visible && focused)
     {
         Rectangle rect = new Rectangle(Image.Bounds.X - 3, Image.Bounds.Y - 3, Image.Bounds.Width + 6, Image.Bounds.Height + 6);
         spriteBatch.Draw(mesh, rect, Color.White);
     }
     base.Draw(spriteBatch);
     text.Draw(spriteBatch);
 }
Ejemplo n.º 19
0
 public override void Render()
 {
     if (_bgcol != Color.Transparent)
     {
         Gorgon.CurrentRenderTarget.FilledRectangle(ClientArea.X, ClientArea.Y, ClientArea.Width,
                                                    ClientArea.Height, _bgcol);
     }
     _icon.Draw();
     Label.Draw();
 }
Ejemplo n.º 20
0
        private void DrawGraph()
        {
            int    totalRecBytes     = 0;
            int    totalSentBytes    = 0;
            double totalMilliseconds = 0d;

            for (int i = 0; i < MaxDataPoints; i++)
            {
                if (_dataPoints.Count <= i)
                {
                    continue;
                }

                totalMilliseconds += _dataPoints[i].ElapsedMilliseconds;
                totalRecBytes     += _dataPoints[i].RecievedBytes;
                totalSentBytes    += _dataPoints[i].SentBytes;

                Gorgon.CurrentRenderTarget = null;

                //Draw recieved line
                Gorgon.CurrentRenderTarget.Rectangle(Gorgon.CurrentRenderTarget.Width - (4 * (MaxDataPoints - i)),
                                                     Gorgon.CurrentRenderTarget.Height -
                                                     (_dataPoints[i].RecievedBytes * 0.1f), 2,
                                                     (_dataPoints[i].RecievedBytes * 0.1f),
                                                     Color.FromArgb(180, Color.Red));

                Gorgon.CurrentRenderTarget.Rectangle(Gorgon.CurrentRenderTarget.Width - (4 * (MaxDataPoints - i)) + 2,
                                                     Gorgon.CurrentRenderTarget.Height - (_dataPoints[i].SentBytes * 0.1f),
                                                     2, (_dataPoints[i].SentBytes * 0.1f),
                                                     Color.FromArgb(180, Color.Green));
            }

            _textSprite.Text = String.Format("Up: {0} kb/s.", Math.Round(totalSentBytes / totalMilliseconds, 6));
            _textSprite.SetPosition(Gorgon.CurrentRenderTarget.Width - (4 * MaxDataPoints) - 100,
                                    Gorgon.CurrentRenderTarget.Height - 30);
            _textSprite.Draw();

            _textSprite.Text = String.Format("Down: {0} kb/s.", Math.Round(totalRecBytes / totalMilliseconds, 6));
            _textSprite.SetPosition(Gorgon.CurrentRenderTarget.Width - (4 * MaxDataPoints) - 100,
                                    Gorgon.CurrentRenderTarget.Height - 60);
            _textSprite.Draw();
        }
Ejemplo n.º 21
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            spriteBatch.Begin();
            arrows.DrawNonAuto();
            ts.Draw();
            spriteBatch.End();
            base.Draw(gameTime);
        }
Ejemplo n.º 22
0
 public void Draw()
 {
     sb.Begin();
     spriteManager.DrawNonAuto();
     stan.Draw();
     easy.Draw();
     medium.Draw();
     hard.Draw();
     abe.Draw();
     sb.End();
 }
Ejemplo n.º 23
0
        private void DrawGraph()
        {
            int    totalRecBytes     = 0;
            int    totalSentBytes    = 0;
            double totalMilliseconds = 0d;

            for (int i = 0; i < MaxDataPoints; i++)
            {
                if (_dataPoints.Count <= i)
                {
                    continue;
                }

                totalMilliseconds += _dataPoints[i].ElapsedMilliseconds;
                totalRecBytes     += _dataPoints[i].ReceivedBytes;
                totalSentBytes    += _dataPoints[i].SentBytes;

                CluwneLib.ResetRenderTarget();

                //Draw recieved line
                CluwneLib.drawRectangle((int)CluwneLib.CurrentRenderTarget.Size.X - (4 * (MaxDataPoints - i)),
                                        (int)CluwneLib.CurrentRenderTarget.Size.Y - (int)(_dataPoints[i].ReceivedBytes * 0.1f),
                                        2,
                                        (int)(_dataPoints[i].ReceivedBytes * 0.1f),
                                        SFML.Graphics.Color.Red.WithAlpha(180));

                CluwneLib.drawRectangle((int)CluwneLib.CurrentRenderTarget.Size.X - (4 * (MaxDataPoints - i)) + 2,
                                        (int)CluwneLib.CurrentRenderTarget.Size.Y - (int)(_dataPoints[i].SentBytes * 0.1f),
                                        2,
                                        (int)(_dataPoints[i].SentBytes * 0.1f),
                                        new SFML.Graphics.Color(0, 128, 0).WithAlpha(180));
            }

            _textSprite.Text     = String.Format("Up: {0} kb/s.", Math.Round(totalSentBytes / totalMilliseconds, 6));
            _textSprite.Position = new Vector2i((int)CluwneLib.CurrentRenderTarget.Size.X - (4 * MaxDataPoints) - 100, (int)CluwneLib.CurrentRenderTarget.Size.Y - 30);
            _textSprite.Draw();

            _textSprite.Text     = String.Format("Down: {0} kb/s.", Math.Round(totalRecBytes / totalMilliseconds, 6));
            _textSprite.Position = new Vector2i((int)CluwneLib.CurrentRenderTarget.Size.X - (4 * MaxDataPoints) - 100, (int)CluwneLib.CurrentRenderTarget.Size.Y - 60);
            _textSprite.Draw();
        }
Ejemplo n.º 24
0
        public override void Render()
        {
            _buttonSprite.Color    = Color;
            _buttonSprite.Position = Position;
            _buttonSprite.Draw();
            _buttonSprite.Color = Color.White;

            if (assignedEffect.doesExpire)
            {
                timeLeft.Draw();
            }
        }
Ejemplo n.º 25
0
        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.Black);

            spriteBatch.Begin(blendState: BlendState.NonPremultiplied);
            engine.Draw(spriteBatch);
            testSprite.Draw(spriteBatch);
            debugText.Draw(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }
Ejemplo n.º 26
0
        public override void Render()
        {
            _buttonSprite.Color    = new SFML.Graphics.Color(Color.R, Color.G, Color.B, Color.A);
            _buttonSprite.Position = new Vector2(Position.X, Position.Y);
            _buttonSprite.Draw();
            _buttonSprite.Color = new SFML.Graphics.Color(Color.White.R, Color.White.G, Color.White.B);

            if (assignedEffect.doesExpire)
            {
                timeLeft.Draw();
            }
        }
Ejemplo n.º 27
0
        public void Render(FrameEventArgs e)
        {
            //public Vertex(Vector2f position, Color color, Vector2f texCoords);

            CluwneLib.CurrentRenderTarget.Clear();

            _lobbyText.Position = new Vector2i(10, 10);
            _lobbyText.Text     = "Server: " + _serverName;
            _lobbyText.Draw();
            _lobbyText.Position = new Vector2i(10, 30);
            _lobbyText.Text     = "Server-Port: " + _serverPort;
            _lobbyText.Draw();
            _lobbyText.Position = new Vector2i(10, 50);
            _lobbyText.Text     = "Max Players: " + _serverMaxPlayers;
            _lobbyText.Draw();
            _lobbyText.Position = new Vector2i(10, 70);
            _lobbyText.Text     = "Gamemode: " + _gameType;
            _lobbyText.Draw();
            _lobbyText.Position = new Vector2i(10, 110);
            _lobbyText.Text     = "MOTD: \n" + _welcomeString;
            _lobbyText.Draw();

            int pos = 225;

            foreach (string plrStr in _playerListStrings)
            {
                _lobbyText.Position = new Vector2i(10, pos);
                _lobbyText.Text     = plrStr;
                _lobbyText.Draw();
                pos += 20;
            }

            UserInterfaceManager.Render();
        }
Ejemplo n.º 28
0
        public void GorgonRender(FrameEventArgs e)
        {
            Gorgon.CurrentRenderTarget.Clear();
            Gorgon.CurrentRenderTarget.FilledRectangle(5, 5, 600, 200, Color.SlateGray);
            Gorgon.CurrentRenderTarget.FilledRectangle(625, 5, Gorgon.CurrentRenderTarget.Width - 625 - 5,
                                                       Gorgon.CurrentRenderTarget.Height - 5 - 6, Color.SlateGray);
            Gorgon.CurrentRenderTarget.FilledRectangle(5, 220, 600, _lobbyChat.Position.Y - 250 - 5, Color.SlateGray);
            _lobbyText.Position = new Vector2D(10, 10);
            _lobbyText.Text     = "Server: " + _serverName;
            _lobbyText.Draw();
            _lobbyText.Position = new Vector2D(10, 30);
            _lobbyText.Text     = "Server-Port: " + _serverPort;
            _lobbyText.Draw();
            _lobbyText.Position = new Vector2D(10, 50);
            _lobbyText.Text     = "Max Players: " + _serverMaxPlayers;
            _lobbyText.Draw();
            _lobbyText.Position = new Vector2D(10, 70);
            _lobbyText.Text     = "Gamemode: " + _gameType;
            _lobbyText.Draw();
            _lobbyText.Position = new Vector2D(10, 110);
            _lobbyText.Text     = "MOTD: \n" + _welcomeString;
            _lobbyText.Draw();

            int pos = 225;

            foreach (string plrStr in _playerListStrings)
            {
                _lobbyText.Position = new Vector2D(10, pos);
                _lobbyText.Text     = plrStr;
                _lobbyText.Draw();
                pos += 20;
            }

            UserInterfaceManager.Render();
        }
Ejemplo n.º 29
0
        //-------------------------------------------------------------------------------------------------------------------------------------------------
        //------------------------------------------- DRAWING TEXT  ------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------------------------------------------------------------------------
        public void DrawText(string text, string fontName, float fontSize, Point pDest, Color color, int rotation, bool wordWrap, Rectangle rectDest, float worldScale)
        {
            try
            {
                GorgonLibrary.Graphics.Font textFont = GetGorgonFont(fontName, fontSize);
                if (textFont != null)
                {
                    textSprite.Font = textFont;
                }
                else
                {
                    if (fontName.Equals("DEFAULT"))
                    {
                        textFont = new GorgonLibrary.Graphics.Font(fontName + "_" + fontSize,
                                                                   new System.Drawing.Font(SystemFonts.DefaultFont.FontFamily, fontSize));
                    }
                    else
                    {
                        textFont = new GorgonLibrary.Graphics.Font(fontName + "_" + fontSize,
                                                                   new System.Drawing.Font(fontName, fontSize));
                    }

                    textSprite.Font = textFont;
                }
                textSprite.Bounds   = null;
                textSprite.WordWrap = false;
                textSprite.Color    = color;
                textSprite.Text     = text;
                textSprite.SetAxis((int)((float)rectDest.Width) / 2, (int)((float)rectDest.Height) / 2);
                textSprite.Rotation = rotation;

                if (wordWrap == false)
                {
                    textSprite.Position = new Vector2D((int)((float)pDest.X * worldScale), (int)((float)pDest.Y * worldScale));
                }
                else
                {
                    textSprite.SetPosition((float)(rectDest.X + textSprite.Axis.X) * worldScale, (float)(rectDest.Y + textSprite.Axis.Y) * worldScale);
                    textSprite.Bounds = new Viewport(0, 0, (int)((float)rectDest.Width), 0);

                    textSprite.WordWrap = wordWrap;
                }



                textSprite.SetScale(worldScale, worldScale);
                textSprite.Draw();
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 30
0
 /// <summary>
 /// Визуализация элемента в текущем кадре
 /// </summary>
 public override void Draw(SpriteBatch spriteBatch)
 {
     if (Visible)
     {
         base.Draw(spriteBatch);
         currentListNumberText.Draw(spriteBatch);
         image2.Draw(spriteBatch);
         foreach (var prev in list[currentListNumber])                   //MAYBE TODO корректная работа при удалении всех превов в рантайме (приводит к удалению всех измерений)
         {
             prev.Draw(spriteBatch);
         }
     }
 }