本文整理汇总了C#中IFont类的典型用法代码示例。如果您正苦于以下问题:C# IFont类的具体用法?C# IFont怎么用?C# IFont使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFont类属于命名空间,在下文中一共展示了IFont类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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));
}
}
示例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;
}
示例4: setFont
public Text setFont( IFont font )
{
_font = font;
updateSize();
return this;
}
示例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);
}
示例6: SetUp
public void SetUp()
{
stubSpriteBatch = MockRepository.GenerateStub<ISpriteBatch>();
stubFont = MockRepository.GenerateStub<IFont>();
stubConsole = MockRepository.GenerateStub<IConsole<string>>();
stubConsole.Log = log;
}
示例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;
}
示例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);
}
示例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;
}
示例10: InputOverlayView
public InputOverlayView(InputLine inputLine, Rectangle inputWindow, IFont font)
{
_inputLine = inputLine;
this.Window = inputWindow;
_font = font;
this.BackgroundColor = OverlaySetView.BACKGROUND_COLOR;
}
示例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;
}
示例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);
}
示例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));
}
示例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;
}
示例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;
}