当前位置: 首页>>代码示例>>C#>>正文


C# Rect.ToList方法代码示例

本文整理汇总了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;
		}
开发者ID:Scottyaim,项目名称:duality,代码行数:36,代码来源:Font.cs

示例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();
        }
开发者ID:ChrisLakeZA,项目名称:duality,代码行数:40,代码来源:Font.cs


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