Added missing summeries #1
This commit is contained in:
parent
03d99ea28e
commit
8665b5b709
104 changed files with 1165 additions and 821 deletions
|
|
@ -32,8 +32,6 @@ namespace SM.Base.Drawing.Text
|
|||
/// </summary>
|
||||
public float FontSize = 12;
|
||||
|
||||
public float Spacing = 1;
|
||||
|
||||
/// <summary>
|
||||
/// The font style.
|
||||
/// <para>Default: <see cref="System.Drawing.FontStyle.Regular" /></para>
|
||||
|
|
@ -45,6 +43,11 @@ namespace SM.Base.Drawing.Text
|
|||
/// </summary>
|
||||
public Dictionary<char, CharParameter> Positions = new Dictionary<char, CharParameter>();
|
||||
|
||||
/// <summary>
|
||||
/// Allows a font wide spacing option.
|
||||
/// </summary>
|
||||
public float Spacing = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Generates a font from a font family from the specified path.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
using System;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using SM.Base;
|
||||
using SM.Base.Windows;
|
||||
using SM.Base.Window;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
@ -27,33 +26,34 @@ namespace SM.Base.Drawing.Text
|
|||
/// </summary>
|
||||
protected string _text;
|
||||
|
||||
/// <summary>
|
||||
/// The width of the text object.
|
||||
/// </summary>
|
||||
public float Width;
|
||||
|
||||
/// <summary>
|
||||
/// The height of the text object.
|
||||
/// </summary>
|
||||
public float Height;
|
||||
|
||||
/// <summary>
|
||||
/// The spacing between numbers.
|
||||
/// <para>Default: 1</para>
|
||||
/// </summary>
|
||||
public float Spacing = 1;
|
||||
|
||||
public float ActualSpacing => Spacing * Font.Spacing;
|
||||
|
||||
public float Width;
|
||||
public float Height;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a text object with a font.
|
||||
/// Calculates the actual spacing for the object.
|
||||
/// </summary>
|
||||
/// <param name="font">The font.</param>
|
||||
protected TextDrawingBasis(Font font)
|
||||
{
|
||||
Material.Texture = font;
|
||||
Material.Blending = true;
|
||||
}
|
||||
public float ActualSpacing => Spacing * Font.Spacing;
|
||||
|
||||
/// <summary>
|
||||
/// The font.
|
||||
/// </summary>
|
||||
public Font Font
|
||||
{
|
||||
get => (Font) Material.Texture;
|
||||
get => (Font)Material.Texture;
|
||||
set
|
||||
{
|
||||
Material.Texture = value;
|
||||
|
|
@ -83,6 +83,16 @@ namespace SM.Base.Drawing.Text
|
|||
set => Material.Tint = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a text object with a font.
|
||||
/// </summary>
|
||||
/// <param name="font">The font.</param>
|
||||
protected TextDrawingBasis(Font font)
|
||||
{
|
||||
Material.Texture = font;
|
||||
Material.Blending = true;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void DrawContext(ref DrawContext context)
|
||||
|
|
@ -137,7 +147,8 @@ namespace SM.Base.Drawing.Text
|
|||
_instances[i] = new Instance
|
||||
{
|
||||
ModelMatrix = matrix,
|
||||
TextureMatrix = TextureTransformation.CalculateMatrix(new Vector2(parameter.NormalizedX, 0), new Vector2(parameter.NormalizedWidth, 1), 0),
|
||||
TextureMatrix = TextureTransformation.CalculateMatrix(new Vector2(parameter.NormalizedX, 0),
|
||||
new Vector2(parameter.NormalizedWidth, 1), 0)
|
||||
};
|
||||
|
||||
x += parameter.Width * ActualSpacing;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue