Even more documentation.
This commit is contained in:
@@ -27,9 +27,9 @@ namespace RecrownedAthenaeum.UI.Skin
|
||||
Dictionary<Type, Dictionary<string, ISkinDefinition>> definitions;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Creates a basic unfilled skin.
|
||||
/// </summary>
|
||||
/// <param name="textureAtlas"></param>
|
||||
/// <param name="textureAtlas">The texture atlas to use for this skin.</param>
|
||||
public Skin(TextureAtlas textureAtlas)
|
||||
{
|
||||
this.textureAtlas = textureAtlas;
|
||||
@@ -38,7 +38,16 @@ namespace RecrownedAthenaeum.UI.Skin
|
||||
definitions = new Dictionary<Type, Dictionary<string, ISkinDefinition>>();
|
||||
}
|
||||
|
||||
public void Draw(string regionName, string color, SpriteBatch batch, Rectangle destination, Type type, float rotation = 0, Vector2 origin = default(Vector2))
|
||||
/// <summary>
|
||||
/// Draws a region from the texture atlas.
|
||||
/// </summary>
|
||||
/// <param name="regionName">Region to draw.</param>
|
||||
/// <param name="color">The color to tint the region.</param>
|
||||
/// <param name="batch">The batch to use.</param>
|
||||
/// <param name="destination">The destination to draw to.</param>
|
||||
/// <param name="rotation">The rotation to use in radians.</param>
|
||||
/// <param name="origin">The origin for the rotation.</param>
|
||||
public void Draw(string regionName, string color, SpriteBatch batch, Rectangle destination, float rotation = 0, Vector2 origin = default(Vector2))
|
||||
{
|
||||
textureAtlas.Draw(regionName, batch, destination, colors[color], rotation, origin);
|
||||
}
|
||||
@@ -90,6 +99,11 @@ namespace RecrownedAthenaeum.UI.Skin
|
||||
return ObtainDefinition<T>(null, type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the definition.
|
||||
/// </summary>
|
||||
/// <param name="definitionName">The name of the definition.</param>
|
||||
/// <param name="skinDefinition">The definition itself.</param>
|
||||
public void AddDefinition(string definitionName, ISkinDefinition skinDefinition)
|
||||
{
|
||||
if (!definitions.ContainsKey(skinDefinition.UIModuleType))
|
||||
@@ -100,6 +114,11 @@ namespace RecrownedAthenaeum.UI.Skin
|
||||
definitions[skinDefinition.UIModuleType].Add(definitionName, skinDefinition);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the definition.
|
||||
/// </summary>
|
||||
/// <param name="definitionName">The name of the definition.</param>
|
||||
/// <param name="definitionType">The type of the definition.</param>
|
||||
public void RemoveDefinition(string definitionName, Type definitionType)
|
||||
{
|
||||
if (definitions.ContainsKey(definitionType) && definitions[definitionType].ContainsKey(definitionName))
|
||||
|
Reference in New Issue
Block a user