當前位置: 首頁>>代碼示例>>C#>>正文


C# Controls.Renderer類代碼示例

本文整理匯總了C#中TomShane.Neoforce.Controls.Renderer的典型用法代碼示例。如果您正苦於以下問題:C# Renderer類的具體用法?C# Renderer怎麽用?C# Renderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Renderer類屬於TomShane.Neoforce.Controls命名空間,在下文中一共展示了Renderer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime time)
        {
            //Create string
            string Txt = "Step " + m_Counter1;
            if (m_ShowNode) Txt += "\r\nVisited nodes " + m_Counter2;
            //	Txt = "raka";

            //Draw string
            renderer.DrawString(m_Font, Txt, rect, Color.White, Alignment.BottomLeft);
        }
開發者ID:yggy123,項目名稱:closed-sky,代碼行數:10,代碼來源:Counter.cs

示例2: DrawControl

        protected override void DrawControl(Renderer renderer,
			Rectangle rect, GameTime gameTime)
        {
            this.Left = this.Left - this.Width; // Eeeeeeeeh?
            this.Top = this.Top - this.Height; // Eeeeeeeeh!
            // As with the panning in TilemapBar I have no idea of what happens in Neoforce...
            // ...but hey, at least I made it work!

            base.DrawControl(renderer, rect, gameTime);
        }
開發者ID:Hoodad,項目名稱:Editor_TLCB,代碼行數:10,代碼來源:CustomToolTip.cs

示例3: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            base.DrawControl(renderer, rect, gameTime);

            clipRect.X = rect.X + 1;
            clipRect.Y = rect.Y + 1;
            renderer.Draw(_clipImg, clipRect, Color.White);

            clipRect.Y += 5;
            renderer.DrawString(_policyTitleFont, PolicyType.Title, clipRect, Color.White, Alignment.TopCenter); 
        }
開發者ID:mrommel,項目名稱:MiRo.SimHexWorld,代碼行數:11,代碼來源:PolicyTypeBox.cs

示例4: DrawControl

    ////////////////////////////////////////////////////////////////////////////

    ////////////////////////////////////////////////////////////////////////////   
    protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
    {                  
      SkinLayer layer = Skin.Layers["Control"];      
      SpriteFont font = (layer.Text != null && layer.Text.Font != null) ? layer.Text.Font.Resource : null;
      Color col = (layer.Text != null) ? layer.Text.Colors.Enabled : Color.White;
      Point offset = new Point(layer.Text.OffsetX, layer.Text.OffsetY);        
               
      renderer.DrawLayer(this, layer, rect);
     
      if (font != null && Text != null && Text != "")
      {                      
        renderer.DrawString(this, layer, Text, new Rectangle(rect.Left, rect.Top + layer.ContentMargins.Top, rect.Width, Skin.ClientMargins.Top - layer.ContentMargins.Horizontal), false, offset.X, offset.Y, false);
      } 
    }
開發者ID:Kammikazy,項目名稱:Neoforce-Mono,代碼行數:17,代碼來源:GroupPanel.cs

示例5: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            //Set color based on state
            Color FontColor = Color.White;
            if (ControlState == ControlState.Hovered) FontColor = Color.Gold;
            if (ControlState == ControlState.Pressed) FontColor = Color.Gray;

            //Set offset based on state
            Rectangle Rect = new Rectangle(rect.X, rect.Y, rect.Width, rect.Height);
            if (ControlState == ControlState.Pressed) {
                Rect.X += 4; Rect.Y += 4;
            }

            //Draw text only
            if (m_Font != null) renderer.DrawString(m_Font, Text, Rect, FontColor, Alignment.MiddleLeft );
        }
開發者ID:yggy123,項目名稱:closed-sky,代碼行數:16,代碼來源:CustomButton.cs

示例6: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime time)
        {
            //Draw the lifebar
            renderer.Draw(m_BarImage, rect, Color.White);

            //For each life
            for (int i = 0; i < m_Life; i++) {
                //Calculate position
                Rectangle LifeRect	 = new Rectangle(rect.Left, rect.Top, m_LifeImage.Width, m_LifeImage.Height);
                LifeRect.X			+= Global.LIFE_X + (i * (m_LifeImage.Width - 2));
                LifeRect.Y			+= Global.LIFE_Y;

                //Draw it
                renderer.Draw(m_LifeImage, LifeRect, Color.White);
            }
        }
開發者ID:yggy123,項目名稱:closed-sky,代碼行數:16,代碼來源:LifeBar.cs

示例7: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            _policyRect.X = rect.X;
            _policyRect.Y = rect.Y;

            if (Policy != null)
            {
                if (MainWindow.Game.Human.Policies.Contains(Policy))
                    renderer.Draw(_button44gold, _policyRect, Color.White);
                else if (MainWindow.Game.Human.PoliciesInReach.Contains(Policy))
                    renderer.Draw(_button44, _policyRect, Color.Gray);
                else
                    renderer.Draw(_button44, _policyRect, Color.White);

                renderer.Draw(Policy.Image, _policyRect, Color.White);
            }            
        }
開發者ID:mrommel,項目名稱:MiRo.SimHexWorld,代碼行數:17,代碼來源:PolicyButton.cs

示例8: Render

        public override void Render(Renderer renderer, GameTime gameTime)
        {
            if (_backgroundBuffer == null)
                UpdateBackground(Width, Height);

            // if buffer is still empty, something wrong
            if (_backgroundBuffer == null)
                return;

            base.Render(renderer, gameTime);

            if (Visible)
            {
                renderer.Begin(BlendingMode.Default);
                renderer.Draw(_backgroundBuffer, this.AbsoluteRect, AlphaColor);
                renderer.End();
            }
        }
開發者ID:mrommel,項目名稱:MiRo.SimHexWorld,代碼行數:18,代碼來源:Grid9Window.cs

示例9: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            if (Player != null)
            {
                _iconRect.X = rect.X;
                _iconRect.Y = rect.Y;

                renderer.Draw(Player.Leader.Image, _iconRect, Color.White);

                renderer.DrawString(_font, Player.Leader.Title, rect.X + 24, rect.Y, Color.White);

                renderer.DrawString(_font, Player.Score.ToString(), rect.X + rect.Width - 20, rect.Y, Color.White);
            }

            _seperatorRect.X = rect.X;
            _seperatorRect.Y = rect.Y + rect.Height - 2;

            renderer.Draw(bar340x2, _seperatorRect, Color.White);
        }
開發者ID:mrommel,項目名稱:MiRo.SimHexWorld,代碼行數:19,代碼來源:RankingRow.cs

示例10: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            base.DrawControl(renderer, rect, gameTime);

            SkinLayer layer = Skin.Layers["Control"];

            if(Text != null && Text != "")
            {
            int width = (int)layer.Text.Font.Resource.MeasureString(Text).X;
            int ox = 5;

            if (width < this.Width)
            {
                ox = (this.Width - width) / 2;
            }
                renderer.DrawString(this, layer, Text, rect, true, ox, 0);

            }
        }
開發者ID:summer-of-software,項目名稱:vtank,代碼行數:19,代碼來源:CursorChangeArea.cs

示例11: DrawControl

        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            // We draw the control the same way the ancestor does.
              // In this case, ancestor draws all states automatically according to description in the skin file.
              base.DrawControl(renderer, rect, gameTime);

              //SkinLayer layer = Skin.Layers[lrButton];
              //int ox = 0; int oy = 0;

              //// We want to have the text pushed a bit down, when we press the button
              //if (ControlState == ControlState.Pressed)
              //{
              //  ox = 1; oy = 1;
              //}

              //// Now we draw text over our control. This method does it automatically,
              //// based on the description in the skin file.
              //// We use our pressed-state offset for text position.
              //renderer.DrawString(this, layer, Text, rect, true, ox, oy);
        }
開發者ID:summer-of-software,項目名稱:vtank,代碼行數:22,代碼來源:Header.cs

示例12: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            if( MainWindow.Game.Human.Technologies.Contains( Tech ))
                renderer.Draw(_backgroundReached, rect, Color.White);
            else if( MainWindow.Game.Human.CurrentResearch == Tech )
                renderer.Draw(_backgroundActive, rect, Color.White);
            else if( MainWindow.Game.Human.PossibleTechnologies.Contains( Tech ) )
                renderer.Draw(_backgroundPossible, rect, Color.White);
            else
                renderer.Draw(_backgroundNoReach, rect, Color.White);

            if( Tech != null )
            {
                _techIconRect.X = rect.X + 2;
                _techIconRect.Y = rect.Y;
                renderer.Draw(Tech.Image, _techIconRect, Color.White);

                _techTitleRect.X = rect.X + 70;
                _techTitleRect.Y = rect.Y + 5;
                renderer.DrawString(_font, Tech.Title,_techTitleRect, Color.White,Alignment.MiddleLeft );
            }
        }
開發者ID:mrommel,項目名稱:MiRo.SimHexWorld,代碼行數:22,代碼來源:TechInfoButton.cs

示例13: DrawControl

        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            if (_buffer == null)
                UpdateBackground(rect.Width, rect.Height);

            // if buffer is still empty, something wrong
            if (_buffer == null)
                return;

            // completely transparent, don't draw anything
            if (Alpha == 0)
                return;

            if (Enabled)
            {
                if (Hovered)
                    renderer.Draw(_bufferGlow, rect, AlphaColor);
                else
                    renderer.Draw(_buffer, rect, AlphaColor);
            }
            else
                renderer.Draw(_bufferDisabled, rect, AlphaColor);
        }
開發者ID:mrommel,項目名稱:MiRo.SimHexWorld,代碼行數:23,代碼來源:Grid9Control.cs

示例14: DrawControl

        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////
        protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
        {
            SkinLayer l1 = Skin.Layers["Control"];
              SkinLayer l2 = Skin.Layers["Selection"];
              rs = new Rectangle[Items.Count];

              renderer.DrawLayer(this, l1, rect, ControlState.Enabled);

              int prev = l1.ContentMargins.Left;
              for (int i = 0; i < Items.Count; i++)
              {
            MenuItem mi = Items[i];

            int tw = (int)l1.Text.Font.Resource.MeasureString(mi.Text).X + l1.ContentMargins.Horizontal;
            rs[i] = new Rectangle(rect.Left + prev, rect.Top + l1.ContentMargins.Top, tw, Height - l1.ContentMargins.Vertical);
            prev += tw;

            if (ItemIndex != i)
            {
              if (mi.Enabled && Enabled)
              {
            renderer.DrawString(this, l1, mi.Text, rs[i], ControlState.Enabled, false);
              }
              else
              {
            renderer.DrawString(this, l1, mi.Text, rs[i], ControlState.Disabled, false);
              }
            }
            else
            {
              if (Items[i].Enabled && Enabled)
              {
            renderer.DrawLayer(this, l2, rs[i], ControlState.Enabled);
            renderer.DrawString(this, l2, mi.Text, rs[i], ControlState.Enabled, false);
              }
              else
              {
            renderer.DrawLayer(this, l2, rs[i], ControlState.Disabled);
            renderer.DrawString(this, l2, mi.Text, rs[i], ControlState.Disabled, false);
              }
            }
              }
        }
開發者ID:Kammikazy,項目名稱:NeoforceControls-SharpDX,代碼行數:45,代碼來源:MainMenu.cs

示例15: DrawControl

    ////////////////////////////////////////////////////////////////////////////

    ////////////////////////////////////////////////////////////////////////////   
    protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
    {
      RecalcParams();
      
      SkinLayer p = Skin.Layers["Control"];
      SkinLayer l = Skin.Layers["Scale"];            
      
      float ratio = 0.66f;
      int h = (int)(ratio * rect.Height);
      int t = rect.Top + (Height - h) / 2;      
            
      float px = ((float)value / (float)range);
      int w = (int)Math.Ceiling(px * (rect.Width - p.ContentMargins.Horizontal - btnSlider.Width)) + 2;
            
      if (w < l.SizingMargins.Vertical) w = l.SizingMargins.Vertical;
      if (w > rect.Width - p.ContentMargins.Horizontal) w = rect.Width - p.ContentMargins.Horizontal;
      
      Rectangle r1 = new Rectangle(rect.Left + p.ContentMargins.Left, t + p.ContentMargins.Top, w, h - p.ContentMargins.Vertical);
            
      base.DrawControl(renderer, new Rectangle(rect.Left, t, rect.Width, h), gameTime);      
      if (scale) renderer.DrawLayer(this, l, r1);      
    }
開發者ID:Kammikazy,項目名稱:Neoforce-Mono,代碼行數:25,代碼來源:TrackBar.cs


注:本文中的TomShane.Neoforce.Controls.Renderer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。