Catch up, several fixes and QoL.

This commit is contained in:
Max
2022-12-16 14:22:34 -06:00
parent 619b89d2a9
commit 1a86e670ca
18 changed files with 1137 additions and 1007 deletions

View File

@ -32,7 +32,7 @@ namespace RobloxFiles.DataTypes
public Vector3 ColumnY => new Vector3(m21, m22, m23);
public Vector3 ColumnZ => new Vector3(m31, m32, m33);
public static readonly CFrame Identity = new CFrame();
public static readonly CFrame identity = new CFrame();
public override int GetHashCode()
{

View File

@ -1,4 +1,5 @@
using RobloxFiles.Enums;
using RobloxFiles.Utility;
namespace RobloxFiles.DataTypes
{
@ -27,6 +28,23 @@ namespace RobloxFiles.DataTypes
Style = style;
}
public static FontFace FromEnum(Font font)
{
return FontUtility.FontFaces[font];
}
public static FontFace FromName(string name, FontWeight weight = FontWeight.Regular, FontStyle style = FontStyle.Normal)
{
Content url = $"rbxasset://fonts/families/{name}.json";
return new FontFace(url, weight, style);
}
public static FontFace FromId(ulong id, FontWeight weight = FontWeight.Regular, FontStyle style = FontStyle.Normal)
{
Content url = $"rbxassetid://{id}";
return new FontFace(url, weight, style);
}
public override string ToString()
{
return $"Font {{ Family = {Family}, Weight = {Weight}, Style = {Style}}}";

View File

@ -64,8 +64,8 @@ namespace RobloxFiles.DataTypes
public static Vector2 zero => new Vector2(0, 0);
public static Vector2 one => new Vector2(1, 1);
public static Vector2 x => new Vector2(1, 0);
public static Vector2 y => new Vector2(0, 1);
public static Vector2 xAxis => new Vector2(1, 0);
public static Vector2 yAxis => new Vector2(0, 1);
public float Dot(Vector2 other) => (X * other.X) + (Y * other.Y);
public Vector2 Cross(Vector2 other) => new Vector2(X * other.Y, Y * other.X);