rj-action-library/Runtime/UI/Styling/UIStyle.cs

114 lines
3.1 KiB
C#
Raw Normal View History

2024-08-09 13:52:49 +00:00
using Godot;
using Rokojori;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class UIStyle:Resource
{
[Export]
public UIStyle parent;
[Export]
public UILayout layoutType;
[ExportCategory("Width")]
[Export]
public float widthValue = 1;
[Export]
public string widthUnit = "vw";
[ExportCategory("Height")]
[Export]
public float heightValue = 1;
[Export]
public string heightUnit = "vw";
[ExportCategory("LineSpacing")]
[Export]
public float lineSpacingValue = 1;
[Export]
public string ineSpacingtUnit = "vw";
public static UINumber Left( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.Left );
}
public static UINumber Right( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.Right );
}
public static UINumber Top( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.Top );
}
public static UINumber Bottom( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.Bottom );
}
public static UINumber Margin( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.Margin );
}
public static UINumber MarginLeft( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.MarginLeft );
}
public static UINumber MarginRight( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.MarginRight );
}
public static UINumber MarginTop( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.MarginTop );
}
public static UINumber MarginBottom( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.MarginBottom );
}
public static UINumber PivotX( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.PivotX );
}
public static UINumber PivotY( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.PivotY );
}
public static UINumber Rotation( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.Rotation );
}
public static UINumber Scale( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.Scale );
}
public static UINumber ScaleX( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.ScaleX );
}
public static UINumber ScaleY( UIStylePropertyContainer container )
{
return container.GetUIStyleNumberProperty( UIStyleNumberProperty.ScaleY );
}
}
}