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

C# IFont类代码示例

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

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



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

示例1: GServerEntry

 public GServerEntry(Server server, IFont font, IHue hue, int x, int y, int width, int selectedBorderColor, int selectedFillColor, float selectedFillAlpha)
     : base(x, y)
 {
     this.m_yBase = y;
     this.m_SelectedBorderColor = selectedBorderColor;
     this.m_SelectedFillColor = selectedFillColor;
     this.m_SelectedFillAlpha = selectedFillAlpha;
     this.m_Server = server;
     this.m_Name = new GLabel(server.Name, font, hue, 4, 4);
     this.m_Name.X -= this.m_Name.Image.xMin;
     base.m_Children.Add(this.m_Name);
     this.m_PercentFull = new GLabel(string.Format("{0}% full", server.PercentFull), font, hue, width - 5, 4);
     this.m_PercentFull.X -= this.m_PercentFull.Image.xMax;
     base.m_Children.Add(this.m_PercentFull);
     int num = (this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1;
     this.m_Height = num;
     num = (this.m_PercentFull.Image.yMax - this.m_PercentFull.Image.yMin) + 1;
     if (num > this.m_Height)
     {
         this.m_Height = num;
     }
     this.m_Height += 8;
     this.m_Name.Y = ((this.m_Height - ((this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1)) / 2) - this.m_Name.Image.yMin;
     this.m_PercentFull.Y = ((this.m_Height - ((this.m_PercentFull.Image.yMax - this.m_PercentFull.Image.yMin) + 1)) / 2) - this.m_PercentFull.Image.yMin;
     this.m_Width = width;
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:26,代码来源:GServerEntry.cs


示例2: GServerList

 public GServerList(Server[] servers, int x, int y, int width, int height, int gumpID, IFont font, IHue hue, int selectionBorderColor, int selectionFillColor, int selectionFillAlpha)
     : base(gumpID, width, height, x, y, true)
 {
     this.m_xLast = -2147483648;
     this.m_yLast = -2147483648;
     int offsetX = base.OffsetX;
     int offsetY = base.OffsetY;
     int useWidth = base.UseWidth;
     this.m_Entries = new GServerEntry[servers.Length];
     for (int i = 0; i < servers.Length; i++)
     {
         this.m_Entries[i] = new GServerEntry(servers[i], font, hue, offsetX, offsetY, useWidth, selectionBorderColor, selectionFillColor, ((float) selectionFillAlpha) / 255f);
         offsetY += this.m_Entries[i].Height - 1;
         base.m_Children.Add(this.m_Entries[i]);
     }
     offsetY++;
     offsetY -= base.OffsetY;
     if (offsetY > (base.UseHeight - 2))
     {
         base.m_Children.Add(new GImage(0x101, this.Width - 6, 4));
         base.m_Children.Add(new GImage(0xff, this.Width - 6, this.Height - 0x25));
         for (int j = 0x22; (j + 0x20) < (this.Height - 5); j += 30)
         {
             base.m_Children.Add(new GImage(0x100, this.Width - 6, j));
         }
         base.m_NonRestrictivePicking = true;
         this.m_Slider = new GVSlider(0xfe, this.Width - 5, 0x11, 13, 0xec, 0.0, 0.0, (double) (offsetY - (base.UseHeight - 2)), 1.0);
         this.m_Slider.OnValueChange = new OnValueChange(this.OnScroll);
         this.m_Slider.ScrollOffset = 20.0;
         base.m_Children.Add(this.m_Slider);
         base.m_Children.Add(new GHotspot(this.Width - 6, 4, 15, this.Height - 9, this.m_Slider));
     }
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:33,代码来源:GServerList.cs


示例3: GSpellName

 public GSpellName(int SpellID, string Name, IFont Font, IHue HRegular, IHue HOver, int X, int Y)
     : base(Name, Font, HRegular, HOver, X, Y, null)
 {
     this.m_SpellID = SpellID;
     base.m_CanDrag = true;
     base.m_QuickDrag = false;
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:7,代码来源:GSpellName.cs


示例4: setFont

		public Text setFont( IFont font )
		{
			_font = font;
			updateSize();

			return this;
		}
开发者ID:prime31,项目名称:Nez,代码行数:7,代码来源:Text.cs


示例5: GHyperLink

 public GHyperLink(string url, string text, IFont font, int x, int y)
     : base(text, font, m_Visited.Contains(url) ? VisitedHue : RegularHue, m_Visited.Contains(url) ? VisitedHue : RegularHue, x, y, null)
 {
     base.Underline = true;
     this.m_Url = url;
     base.OnClick = new OnClick(this.Button_OnClick);
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:7,代码来源:GHyperLink.cs


示例6: SetUp

 public void SetUp()
 {
     stubSpriteBatch = MockRepository.GenerateStub<ISpriteBatch>();
     stubFont = MockRepository.GenerateStub<IFont>();
     stubConsole = MockRepository.GenerateStub<IConsole<string>>();
     stubConsole.Log = log;
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:7,代码来源:OverlayViewImplementationTests.cs


示例7: RowTextContent

 internal RowTextContent(int tableId, ITemplate template,
     PointGeometry pos, IFont font, double height, double width, float rotation)
     : base(pos, font, height, width, rotation)
 {
     m_TableId = tableId;
     m_TemplateId = 0;
 }
开发者ID:steve-stanton,项目名称:backsight,代码行数:7,代码来源:RowTextContent.cs


示例8: TextGeometry

 /// <summary>
 /// Creates a new <c>TextGeometry</c>
 /// </summary>
 /// <param name="pos">Position of the text's reference point (always the top left corner of the string).</param>
 /// <param name="font">The text style (defines the type-face and the height of the text).</param>
 /// <param name="height">The height of the text, in meters on the ground.</param>
 /// <param name="width">The total width of the text, in meters on the ground.</param>
 /// <param name="rotation">Clockwise rotation from horizontal</param>
 protected TextGeometry(PointGeometry pos, IFont font, double height, double width, float rotation)
 {
     m_Font = font;
     m_Position = pos;
     m_Height = (float)height;
     m_Width = (float)width;
     m_Rotation = new RadianValue((double)rotation);
 }
开发者ID:steve-stanton,项目名称:backsight,代码行数:16,代码来源:TextGeometry.cs


示例9: TextPainter

 public TextPainter(Plotter plotter, IFont font, int sizeX, int sizeY, int spaceX)
 {
     this.plotter = plotter;
     this.font = font;
     this.sizeX = sizeX;
     this.sizeY = sizeY;
     this.spaceX = spaceX;
 }
开发者ID:Alias007,项目名称:InternetOfThings,代码行数:8,代码来源:TextPainter.cs


示例10: InputOverlayView

        public InputOverlayView(InputLine inputLine, Rectangle inputWindow, IFont font)
        {
            _inputLine = inputLine;
            this.Window = inputWindow;
            _font = font;

            this.BackgroundColor = OverlaySetView.BACKGROUND_COLOR;
        }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:8,代码来源:InputHudView.cs


示例11: GListBox

 public GListBox(IFont Font, IHue HRegular, IHue HOver, int BackID, int X, int Y, int Width, int Height, bool HasBorder)
     : base(BackID, Width, Height, X, Y, HasBorder)
 {
     this.m_Font = Font;
     this.m_HRegular = HRegular;
     this.m_HOver = HOver;
     this.m_ItemCount = base.UseHeight / 0x12;
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:8,代码来源:GListBox.cs


示例12: ConsoleOverlaySetView

 public ConsoleOverlaySetView(IOverlayView inputView, IOverlayView commandConsoleView, IOverlayView messageConsoleView, IOverlayView possibleCommandsView, ISpriteBatch spriteBatch, ITexture texture, IFont font)
     : base(spriteBatch, texture, font)
 {
     _overlays.Add(inputView);
     _overlays.Add(commandConsoleView);
     _overlays.Add(messageConsoleView);
     _overlays.Add(possibleCommandsView);
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:8,代码来源:ConsoleOverlaySetView.cs


示例13: GDynamicMessage

 private GDynamicMessage(bool unremovable, IMessageOwner owner, string text, IFont font, IHue hue, float duration)
     : base(text, font, hue, Hues.Load(0x35), 0, 0, null)
 {
     this.m_Unremovable = unremovable;
     base.m_OverridesCursor = false;
     this.m_Owner = owner;
     this.m_SolidDuration = duration;
     this.m_Dispose = new TimeSync((double) (this.m_SolidDuration + 1f));
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:9,代码来源:GDynamicMessage.cs


示例14: GSystemMessage

 public GSystemMessage(string text, IFont font, IHue hue, float duration)
     : base(text, font, hue, 0, 0)
 {
     base.m_OverridesCursor = false;
     this.m_SolidDuration = duration;
     this.m_Dispose = new TimeSync((double) (this.m_SolidDuration + 1f));
     this.m_UpdateTime = DateTime.Now;
     this.m_DupeCount = 1;
     this.m_OrigText = text;
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:10,代码来源:GSystemMessage.cs


示例15: GetTextHeight

        /// <summary>
        ///     Gets the height of a text written in a specific font.
        /// </summary>
        /// <param name="text">The text's string.</param>
        /// <param name="font">The text's font.</param>
        /// <returns>The height of the text.</returns>
        public static float GetTextHeight(string text, IFont font)
        {
            var maxH = 0.0f;

            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var letter in text)
                maxH = System.Math.Max(maxH, font.CharInfo[letter].BitmapH);

            return maxH;
        }
开发者ID:GameProduction,项目名称:ScharfschiessenGame,代码行数:16,代码来源:GUIText.cs


示例16: GWrappedLabel

 public GWrappedLabel(string text, IFont font, IHue hue, int x, int y, int width)
     : base(x, y)
 {
     this.m_WrapWidth = width;
     base.m_Text = text;
     base.m_Font = font;
     base.m_Hue = hue;
     base.m_ITranslucent = true;
     this.Refresh();
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:10,代码来源:GWrappedLabel.cs


示例17: RichLabel

 public RichLabel()
 {
     text = new List<RichLabelString>();
     Fonts = new List<IFont>();
     Fonts.Add(GUI.Instance.Skin.Font);
     activeFont = Fonts[0];
     Colors = new List<Color>();
     Colors.Add(Color.Black);
     activeColor = Colors[0];
 }
开发者ID:pzaps,项目名称:CrossGFX,代码行数:10,代码来源:RichLabel.cs


示例18: SetUp

 public void SetUp()
 {
     stubInputView = MockRepository.GenerateStub<IOverlayView>();
     stubCommandConsoleView = MockRepository.GenerateStub<IOverlayView>();
     stubMessageConsoleView = MockRepository.GenerateStub<IOverlayView>();
     stubPossibleCommandsView = MockRepository.GenerateStub<IOverlayView>();
     stubSpriteBatch = MockRepository.GenerateStub<ISpriteBatch>();
     stubTexture = MockRepository.GenerateStub<ITexture>();
     stubFont = MockRepository.GenerateStub<IFont>();
     hudView = new ConsoleOverlaySetView(stubInputView, stubCommandConsoleView, stubMessageConsoleView, stubPossibleCommandsView, stubSpriteBatch, stubTexture, stubFont);
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:11,代码来源:ConsoleOverlaySetViewTests.cs


示例19: GAttributeCurMax

 public GAttributeCurMax(int x, int y, int w, int h, int c, int m, IFont font, IHue hue)
     : base(x, y, w, h)
 {
     this.m_Current = c;
     this.m_Maximum = m;
     this.m_GCurrent = new GWrappedLabel(this.m_Current.ToString(), font, hue, 0, 0, w * 2);
     this.m_GMaximum = new GWrappedLabel(this.m_Maximum.ToString(), font, hue, 0, 11, w * 2);
     base.m_Children.Add(this.m_GCurrent);
     base.m_Children.Add(this.m_GMaximum);
     this.Update();
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:11,代码来源:GAttributeCurMax.cs


示例20: Text

		public Text( IFont font, string text, Vector2 localOffset, Color color )
		{
			_font = font;
			_text = text;
			_localOffset = localOffset;
			this.color = color;
			_horizontalAlign = HorizontalAlign.Left;
			_verticalAlign = VerticalAlign.Top;

			updateSize();
		}
开发者ID:prime31,项目名称:Nez,代码行数:11,代码来源:Text.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IFoo类代码示例发布时间:2022-05-24
下一篇:
C# IFolderInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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