Update a sprite-info from another sprite-info
This commit is contained in:
parent
caf7f8cbd2
commit
ee9f046562
@ -49,6 +49,22 @@ namespace SpriteLibrary
|
||||
return SpriteDatabase.CloneByXMLSerializing<SpriteInfo>(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the current SpriteInfo class such that it is identical to the class you are copying from.
|
||||
/// </summary>
|
||||
/// <param name="toCopyFrom">A spriteInfo class</param>
|
||||
public void CopyFrom(SpriteInfo toCopyFrom)
|
||||
{
|
||||
if (toCopyFrom == null) return;
|
||||
SpriteName = toCopyFrom.SpriteName;
|
||||
ViewPercent = toCopyFrom.ViewPercent;
|
||||
Animations.Clear();
|
||||
foreach(AnimationInfo AI in toCopyFrom.Animations)
|
||||
{
|
||||
Animations.Add(AI.Clone());
|
||||
}
|
||||
}
|
||||
|
||||
public Sprite CreateSprite(SpriteController ControllerToUse, SpriteDatabase TheDatabaseToUse)
|
||||
{
|
||||
Sprite DestSprite = null;
|
||||
|
Loading…
Reference in New Issue
Block a user