Added new extension "byte.Lerp". Added new extension "Log" for "TraceLogLevel". Constructors on Color no longer just truncate the float value, but also round it (+ 0.5f). New static method on Color, "Color.Lerp". Added static method "FromHSV" to Color. Added new getter method "GetHSV" on Color. Added index security on the FilePathList indexer. Merged Rectangle extensions with the type itself as read-only methods. Merged Image extensions with the type itself. Merged Texture2D extensions with the type itself. New file "Raymath.Utils" with some useful methods taken from Unity. Added "MoveTowards" extensions to RaylibExtensions. Added "TranslateLocal" and "TranslateGlobal" to Transform. Added "Load", "Export", "ExportAsCode", "Format", "Crop", and "Unload" shortcut methods to Wave. Added "IsValid" property to Wave, Texture2D, Sound, Shader, RenderTexture2D, Music, Image, Model, Material, Font, and AudioStream. Added "IsPlaying" and "IsProcessed" properties to AudioStream. Added "Load", "Play", "Stop", "Pause", "Resume", "SetBufferSizeDefault", "SetPan", "SetPitch", "SetVolume", and "Unload" shortcut methods to AudioStream. Added "Load", "Export", and "Unload" methods to AutomationEventList. Added "Default" property to Font. Added "Load", "GetMaterial", "GetTexture", "SetTexture", "SetShader", and "Unload" methods to material. Added "Draw", "DrawInstanced", "Export", "ExportAsCode", "Upload", and "Unload" methods to Mesh. Added "Load", "LoadFromMesh", "Unload", and a lot of "Draw" overloads. Added "Load", "Play", "Pause", "Stop", "SetPan", "SetPitch", "SetVolume", "Seek", and "Unload" methods to Music. Added "Load" and "Unload" methods to RenderTexture2D. Added "Load", "LoadFromMemory", "GetLocationAttrib", "SetValue", "SetTexture", "SetMatrix", and "Unload" methods to Shader. Removed unnecessary "partial" declarations.
97 lines
1.9 KiB
C#
97 lines
1.9 KiB
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace Raylib_cs;
|
|
|
|
/// <summary>
|
|
/// Font type, defines generation method
|
|
/// </summary>
|
|
public enum FontType
|
|
{
|
|
/// <summary>
|
|
/// Default font generation, anti-aliased
|
|
/// </summary>
|
|
Default = 0,
|
|
|
|
/// <summary>
|
|
/// Bitmap font generation, no anti-aliasing
|
|
/// </summary>
|
|
Bitmap,
|
|
|
|
/// <summary>
|
|
/// SDF font generation, requires external shader
|
|
/// </summary>
|
|
Sdf
|
|
}
|
|
|
|
/// <summary>
|
|
/// GlyphInfo, font characters glyphs info
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public partial struct GlyphInfo
|
|
{
|
|
/// <summary>
|
|
/// Character value (Unicode)
|
|
/// </summary>
|
|
public int Value;
|
|
|
|
/// <summary>
|
|
/// Character offset X when drawing
|
|
/// </summary>
|
|
public int OffsetX;
|
|
|
|
/// <summary>
|
|
/// Character offset Y when drawing
|
|
/// </summary>
|
|
public int OffsetY;
|
|
|
|
/// <summary>
|
|
/// Character advance position X
|
|
/// </summary>
|
|
public int AdvanceX;
|
|
|
|
/// <summary>
|
|
/// Character image data
|
|
/// </summary>
|
|
public Image Image;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Font, font texture and GlyphInfo array data
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public unsafe struct Font
|
|
{
|
|
/// <summary>
|
|
/// Base size (default chars height)
|
|
/// </summary>
|
|
public int BaseSize;
|
|
|
|
/// <summary>
|
|
/// Number of characters
|
|
/// </summary>
|
|
public int GlyphCount;
|
|
|
|
/// <summary>
|
|
/// Padding around the glyph characters
|
|
/// </summary>
|
|
public int GlyphPadding;
|
|
|
|
/// <summary>
|
|
/// Texture atlas containing the glyphs
|
|
/// </summary>
|
|
public Texture2D Texture;
|
|
|
|
/// <summary>
|
|
/// Rectangles in texture for the glyphs
|
|
/// </summary>
|
|
public Rectangle* Recs;
|
|
|
|
/// <summary>
|
|
/// Glyphs info data
|
|
/// </summary>
|
|
public GlyphInfo* Glyphs;
|
|
|
|
public readonly CBool IsValid => Raylib.IsFontValid(this);
|
|
|
|
public static Font Default => Raylib.GetFontDefault();
|
|
}
|