189 lines
4.8 KiB
C#
189 lines
4.8 KiB
C#
|
|
using Godot;
|
|
using Rokojori;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Rokojori
|
|
{
|
|
[Tool]
|
|
[GlobalClass]
|
|
public partial class UIImage:TextureRect, UIStylePropertyContainer
|
|
{
|
|
[Export]
|
|
public UIStyle parentStyle;
|
|
|
|
[ExportGroup("Size & Margins")]
|
|
[Export]
|
|
public UINumber width;
|
|
|
|
[Export]
|
|
public UINumber height;
|
|
|
|
|
|
[Export]
|
|
public UINumber margin;
|
|
|
|
[Export]
|
|
public UINumber marginLeft;
|
|
[Export]
|
|
public UINumber marginTop;
|
|
[Export]
|
|
public UINumber marginRight;
|
|
[Export]
|
|
public UINumber marginBottom;
|
|
|
|
|
|
[ExportGroup( "Position" )]
|
|
[Export]
|
|
public UIPosition position;
|
|
[Export]
|
|
public UILineWrap lineWrap;
|
|
[Export]
|
|
public UINumber left;
|
|
[Export]
|
|
public UINumber top;
|
|
[Export]
|
|
public UINumber right;
|
|
[Export]
|
|
public UINumber bottom;
|
|
|
|
|
|
[ExportGroup( "Rotation & Scale" )]
|
|
[Export]
|
|
public UINumber pivotX;
|
|
[Export]
|
|
public UINumber pivotY;
|
|
|
|
[Export]
|
|
public UINumber rotation;
|
|
|
|
[Export]
|
|
public UINumber scale;
|
|
|
|
[Export]
|
|
public UINumber scaleX;
|
|
[Export]
|
|
public UINumber scaleY;
|
|
|
|
[ExportGroup( "Shader Properties" )]
|
|
[Export]
|
|
public ShaderUIColor[] colorProperties;
|
|
public List<ActiveStyleTransition<UIColor,ColorPropertyName>> activeShaderColorTransitions = new List<ActiveStyleTransition<UIColor,ColorPropertyName>>();
|
|
public List<ActiveStyleTransition<UIColor,ColorPropertyName>> GetActiveShaderUIColorTransitions()
|
|
{
|
|
return activeShaderColorTransitions;
|
|
}
|
|
|
|
[Export]
|
|
public ShaderUINumber[] numberProperties;
|
|
public List<ActiveStyleTransition<UINumber,FloatPropertyName>> activeShaderNumberTransitions = new List<ActiveStyleTransition<UINumber,FloatPropertyName>>();
|
|
public List<ActiveStyleTransition<UINumber,FloatPropertyName>> GetActiveShaderUINumberTransitions()
|
|
{
|
|
return activeShaderNumberTransitions;
|
|
}
|
|
|
|
[ExportGroup("Transitions")]
|
|
[Export]
|
|
public TransitionSettingsAll transitionSettings;
|
|
public TransitionSettingsAll GetTransitionSettingsAll()
|
|
{
|
|
return transitionSettings;
|
|
}
|
|
|
|
[Export]
|
|
public UINumberTransition[] numberTransitions;
|
|
public UINumberTransition[] GetNumberTransitions()
|
|
{
|
|
return numberTransitions;
|
|
}
|
|
|
|
public List<ActiveStyleTransition<UINumber,UIStyleNumberProperty>> activeNumberTransitions = new List<ActiveStyleTransition<UINumber,UIStyleNumberProperty>>();
|
|
public List<ActiveStyleTransition<UINumber,UIStyleNumberProperty>> GetActiveUINumberTransitions()
|
|
{
|
|
return activeNumberTransitions;
|
|
}
|
|
|
|
[Export]
|
|
public UIColorTransition[] colorTransitions;
|
|
public UIColorTransition[] GetColorTransitions()
|
|
{
|
|
return colorTransitions;
|
|
}
|
|
|
|
public List<ActiveStyleTransition<UIColor,UIStyleColorProperty>> activeColorTransitions = new List<ActiveStyleTransition<UIColor,UIStyleColorProperty>>();
|
|
public List<ActiveStyleTransition<UIColor,UIStyleColorProperty>> GetActiveUIColorTransitions()
|
|
{
|
|
return activeColorTransitions;
|
|
}
|
|
|
|
|
|
|
|
public UIStyle GetUIStyleParent()
|
|
{
|
|
return parentStyle;
|
|
}
|
|
|
|
public UIPosition GetUIPosition()
|
|
{
|
|
return position;
|
|
}
|
|
|
|
public UILineWrap GetUILineWrap()
|
|
{
|
|
return lineWrap;
|
|
}
|
|
|
|
public UILayout GetUILayout()
|
|
{
|
|
return UILayout.___;
|
|
}
|
|
|
|
|
|
public ShaderUIColor[] GetShaderUIColors()
|
|
{
|
|
return colorProperties;
|
|
}
|
|
|
|
public ShaderUINumber[] GetShaderUINumbers()
|
|
{
|
|
return numberProperties;
|
|
}
|
|
|
|
public UINumber GetUIStyleNumberProperty( UIStyleNumberProperty property )
|
|
{
|
|
switch ( property )
|
|
{
|
|
case UIStyleNumberProperty.Width: return width;
|
|
case UIStyleNumberProperty.Height: return height;
|
|
|
|
case UIStyleNumberProperty.Margin: return margin;
|
|
|
|
case UIStyleNumberProperty.MarginLeft: return marginLeft;
|
|
case UIStyleNumberProperty.MarginRight: return marginRight;
|
|
case UIStyleNumberProperty.MarginTop: return marginTop;
|
|
case UIStyleNumberProperty.MarginBottom: return marginBottom;
|
|
|
|
|
|
case UIStyleNumberProperty.Left: return left;
|
|
case UIStyleNumberProperty.Right: return right;
|
|
case UIStyleNumberProperty.Top: return top;
|
|
case UIStyleNumberProperty.Bottom: return bottom;
|
|
|
|
case UIStyleNumberProperty.PivotX: return pivotX;
|
|
case UIStyleNumberProperty.PivotY: return pivotY;
|
|
case UIStyleNumberProperty.Rotation: return rotation;
|
|
|
|
case UIStyleNumberProperty.Scale: return scale;
|
|
case UIStyleNumberProperty.ScaleX: return scaleX;
|
|
case UIStyleNumberProperty.ScaleY: return scaleY;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public UIColor GetUIStyleColorProperty( UIStyleColorProperty property )
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
} |