本文整理汇总了C#中Rect.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# Rect.ToList方法的具体用法?C# Rect.ToList怎么用?C# Rect.ToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect.ToList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetGlyphData
/// <summary>
/// Applies a new set of rendered glyphs to the <see cref="Font"/>, adjusts its typeface metadata and clears out the <see cref="GlyphsDirty"/> flag.
/// This method is used by the editor to update a Font after adjusting its properties.
/// </summary>
/// <param name="bitmap"></param>
/// <param name="atlas"></param>
/// <param name="glyphs"></param>
/// <param name="height"></param>
/// <param name="ascent"></param>
/// <param name="bodyAscent"></param>
/// <param name="descent"></param>
/// <param name="baseLine"></param>
public void SetGlyphData(PixelData bitmap, Rect[] atlas, GlyphData[] glyphs, int height, int ascent, int bodyAscent, int descent, int baseLine)
{
this.ReleaseResources();
this.glyphs = glyphs;
this.GenerateCharLookup();
this.pixelData = new Pixmap(bitmap);
this.pixelData.Atlas = atlas.ToList();
this.height = height;
this.ascent = ascent;
this.bodyAscent = bodyAscent;
this.descent = descent;
this.baseLine = baseLine;
for (int i = 0; i < this.glyphs.Length; i++)
{
this.maxGlyphWidth = Math.Max(this.maxGlyphWidth, this.glyphs[i].Width);
}
this.UpdateKerningData();
this.GenerateTexMat();
this.glyphsDirty = false;
}
示例2: SetGlyphData
/// <summary>
/// Applies a new set of rendered glyphs to the <see cref="Font"/>, adjusts its typeface metadata and clears out the <see cref="GlyphsDirty"/> flag.
/// This method is used by the editor to update a Font after adjusting its properties.
/// </summary>
/// <param name="bitmap"></param>
/// <param name="atlas"></param>
/// <param name="glyphs"></param>
/// <param name="metrics"></param>
public void SetGlyphData(PixelData bitmap, Rect[] atlas, GlyphData[] glyphs, FontMetrics metrics)
{
this.ReleaseResources();
this.glyphs = glyphs;
this.GenerateCharLookup();
this.pixelData = new Pixmap(bitmap);
this.pixelData.Atlas = atlas.ToList();
this.metrics = metrics;
// Copy metrics data into local fields.
// Remove this on the next major version step.
this.size = metrics.Size;
this.height = metrics.Height;
this.ascent = metrics.Ascent;
this.bodyAscent = metrics.BodyAscent;
this.descent = metrics.Descent;
this.baseLine = metrics.BaseLine;
this.monospace = metrics.Monospace;
this.maxGlyphWidth = 0;
for (int i = 0; i < this.glyphs.Length; i++)
{
this.maxGlyphWidth = Math.Max(this.maxGlyphWidth, this.glyphs[i].Width);
}
this.UpdateKerningData();
this.GenerateTexture();
this.GenerateMaterial();
}