// Copyright (c) Craftwork Games. All rights reserved. // Licensed under the MIT license. // See LICENSE file in the project root for full license information. using System.Collections.Generic; using MonoGame.Extended.Graphics; namespace MonoGame.Extended.BitmapFonts; /// /// Represents a character in a bitmap font. This class cannot be inherited. /// public sealed class BitmapFontCharacter { /// /// Gets the character code. /// public int Character { get; } /// /// Gets the texture region that contains the character's image. /// public Texture2DRegion TextureRegion { get; } /// /// Gets the horizontal offset for rendering the character. /// public int XOffset { get; } /// /// Gets the vertical offset for rendering the character. /// public int YOffset { get; } /// /// Gets the horizontal advance value for rendering the next character. /// public int XAdvance { get; } /// /// Gets the dictionary of kerning values for pairs of characters. /// public Dictionary Kernings { get; } /// /// Initializes a new instance of the class. /// /// The character code. /// The texture region that contains the character's image. /// The horizontal offset for rendering the character. /// The vertical offset for rendering the character. /// The horizontal advance value for rendering the next character. public BitmapFontCharacter(int character, Texture2DRegion textureRegion, int xOffset, int yOffset, int xAdvance) { Character = character; TextureRegion = textureRegion; XOffset = xOffset; YOffset = yOffset; XAdvance = xAdvance; Kernings = new Dictionary(); } }