• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.Renderer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TomShane.Neoforce.Controls.Renderer的典型用法代码示例。如果您正苦于以下问题:C# Renderer类的具体用法?C# Renderer怎么用?C# Renderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Renderer类属于TomShane.Neoforce.Controls命名空间,在下文中一共展示了Renderer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: DrawControl

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

		////////////////////////////////////////////////////////////////////////////
		protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
		{
			SkinLayer l1 = Skin.Layers["Control"];
			SkinLayer l2 = Skin.Layers["Header"];
			Color col = this.Color != UndefinedColor ? this.Color : Color.White;

			Rectangle r1 = new Rectangle(rect.Left, rect.Top + l1.OffsetY, rect.Width, rect.Height - l1.OffsetY);
			if (tabPages.Count <= 0)
			{
				r1 = rect;
			}

			base.DrawControl(renderer, r1, gameTime);

			if (tabPages.Count > 0)
			{

				Rectangle prev = new Rectangle(rect.Left, rect.Top + l2.OffsetY, 0, l2.Height);
				for (int i = 0; i < tabPages.Count; i++)
				{
					SpriteFont font = l2.Text.Font.Resource;
					Margins margins = l2.ContentMargins;
					Point offset = new Point(l2.OffsetX, l2.OffsetY);
					if (i > 0) prev = tabPages[i - 1].HeaderRect;

					tabPages[i].CalcRect(prev, font, margins, offset, i == 0);
				}

				for (int i = tabPages.Count - 1; i >= 0; i--)
				{
					int li = tabPages[i].Enabled ? l2.States.Enabled.Index : l2.States.Disabled.Index;
					Color lc = tabPages[i].Enabled ? l2.Text.Colors.Enabled : l2.Text.Colors.Disabled;
					if (i == hoveredIndex)
					{
						li = l2.States.Hovered.Index;
						lc = l2.Text.Colors.Hovered;
					}


					Margins m = l2.ContentMargins;
					Rectangle rx = tabPages[i].HeaderRect;
					Rectangle sx = new Rectangle(rx.Left + m.Left, rx.Top + m.Top, rx.Width - m.Horizontal, rx.Height - m.Vertical);
					if (i != selectedIndex)
					{
						renderer.DrawLayer(l2, rx, col, li);
						renderer.DrawString(l2.Text.Font.Resource, tabPages[i].Text, sx, lc, l2.Text.Alignment);
					}
				}

				Margins mi = l2.ContentMargins;
				Rectangle ri = tabPages[selectedIndex].HeaderRect;
				Rectangle si = new Rectangle(ri.Left + mi.Left, ri.Top + mi.Top, ri.Width - mi.Horizontal, ri.Height - mi.Vertical);
				renderer.DrawLayer(l2, ri, col, l2.States.Focused.Index);
				renderer.DrawString(l2.Text.Font.Resource, tabPages[selectedIndex].Text, si, l2.Text.Colors.Focused, l2.Text.Alignment, l2.Text.OffsetX, l2.Text.OffsetY, false);
			}
		}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:59,代码来源:TabControl.cs


示例17: Initialize

        ////////////////////////////////////////////////////////////////////////////      
        ////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Initializes the controls manager.
        /// </summary>    
        ////////////////////////////////////////////////////////////////////////////
        public override void Initialize()
        {
            base.Initialize();

              if (autoCreateRenderTarget)
              {
            if (renderTarget != null)
            {
              renderTarget.Dispose();
            }
            renderTarget = CreateRenderTarget();
              }

              GraphicsDevice.DeviceReset += new System.EventHandler<System.EventArgs>(GraphicsDevice_DeviceReset);

              input.Initialize();
              renderer = new Renderer(this);
              SetSkin(skinName);
        }
开发者ID:999eagle,项目名称:NeoforceControls,代码行数:25,代码来源:Manager.cs


示例18: DrawControl

    ////////////////////////////////////////////////////////////////////////////
    
    ////////////////////////////////////////////////////////////////////////////
    protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
    {                    

      if (mode == ButtonMode.PushButton && pushed)
      {
        SkinLayer l = Skin.Layers[lrButton];
        renderer.DrawLayer(l, rect, l.States.Pressed.Color, l.States.Pressed.Index);
        if (l.States.Pressed.Overlay)
        {
          renderer.DrawLayer(l, rect, l.Overlays.Pressed.Color, l.Overlays.Pressed.Index);          
        }                
      }
      else
      {
        base.DrawControl(renderer, rect, gameTime);
      }
    
      SkinLayer layer = Skin.Layers[lrButton];                                  
      SpriteFont font = (layer.Text != null && layer.Text.Font != null) ? layer.Text.Font.Resource : null;
      Color col = Color.White;              
      int ox = 0; int oy = 0;
    
      if (ControlState == ControlState.Pressed)
      {       
        if (layer.Text != null) col = layer.Text.Colors.Pressed;
        ox = 1; oy = 1;
      }                               
      if (glyph != null)
      {
        Margins cont = layer.ContentMargins;
        Rectangle r = new Rectangle(rect.Left + cont.Left, 
                                    rect.Top + cont.Top, 
                                    rect.Width - cont.Horizontal, 
                                    rect.Height - cont.Vertical);
        renderer.DrawGlyph(glyph, r);
      }
      else 
      {
        renderer.DrawString(this, layer, Text, rect, true, ox, oy);
      }       
    }
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:44,代码来源:Button.cs


示例19: Render

    ////////////////////////////////////////////////////////////////////////////
    
    ////////////////////////////////////////////////////////////////////////////
    internal override void Render(Renderer renderer, GameTime gameTime)
    {      
      if (Visible && Shadow)
      {        
        SkinControl c = Manager.Skin.Controls[skShadow];
        SkinLayer l = c.Layers[lrShadow];

        Color cl = Color.FromNonPremultiplied(l.States.Enabled.Color.R, l.States.Enabled.Color.G, l.States.Enabled.Color.B, Alpha);

        renderer.Begin(BlendingMode.Default);
        renderer.DrawLayer(l, new Rectangle(Left - c.OriginMargins.Left, Top - c.OriginMargins.Top, Width + c.OriginMargins.Horizontal, Height + c.OriginMargins.Vertical), cl, 0);
        renderer.End();
      }
      base.Render(renderer, gameTime);
    }
开发者ID:Kammikazy,项目名称:Neoforce-Mono,代码行数:18,代码来源:Window.cs


示例20: Initialize

        ////////////////////////////////////////////////////////////////////////////      
        ////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Initializes the controls manager.
        /// </summary>    
        ////////////////////////////////////////////////////////////////////////////
        public override void Initialize()
        {
            base.Initialize();

            Game.Window.ClientSizeChanged += (object sender, System.EventArgs e) =>
            {
                InvalidateRenderTarget();
            };

            if (autoCreateRenderTarget)
            {
                if (renderTarget != null)
                {
                    renderTarget.Dispose();
                }
                renderTarget = CreateRenderTarget();
            }

            GraphicsDevice.DeviceReset += new System.EventHandler<System.EventArgs>(GraphicsDevice_DeviceReset);

            input.Initialize();
            renderer = new Renderer(this);
            SetSkin(skinName);
        }
开发者ID:benburt,项目名称:Neoforce-Mono,代码行数:30,代码来源:Manager.cs



注:本文中的TomShane.Neoforce.Controls.Renderer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tomboy.Note类代码示例发布时间:2022-05-26
下一篇:
C# Controls.Manager类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap