本文整理匯總了C#中AnimatedSprite.Load方法的典型用法代碼示例。如果您正苦於以下問題:C# AnimatedSprite.Load方法的具體用法?C# AnimatedSprite.Load怎麽用?C# AnimatedSprite.Load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AnimatedSprite
的用法示例。
在下文中一共展示了AnimatedSprite.Load方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetAnimation
/// <summary>
/// Returns the proper animation for the given tile
/// </summary>
/// <param name="name">Name of the tile that needs to be animated</param>
/// <returns></returns>
private AnimatedSprite GetAnimation(string name)
{
string concatName = name.Substring(name.LastIndexOf('\\') + 1);
AnimatedSprite newAnimation = new AnimatedSprite();
wallEngine.colorScheme = concatName;
switch (concatName)
{
case "Green":
if(mUseVert)
newAnimation.Load(mContent, "GreenVert", 4, 0.15f);
else newAnimation.Load(mContent, "GreenHor", 4, 0.15f);
mUseVert = !mUseVert;
break;
case "Pink":
if(mUseVert)
newAnimation.Load(mContent, "PinkVert", 4, 0.15f);
else newAnimation.Load(mContent, "PinkHor", 4, 0.15f);
mUseVert = !mUseVert;
break;
case "Blue":
if(mUseVert)
newAnimation.Load(mContent, "BlueVert", 4, 0.15f);
else newAnimation.Load(mContent, "BlueHor", 4, 0.15f);
mUseVert = !mUseVert;
break;
case "Yellow":
if(mUseVert)
newAnimation.Load(mContent, "YellowVert", 4, 0.15f);
else newAnimation.Load(mContent, "YellowHor", 4, 0.15f);
mUseVert = !mUseVert;
break;
case "Purple":
if(mUseVert)
newAnimation.Load(mContent, "PurpleVert", 4, 0.15f);
else newAnimation.Load(mContent, "PurpleHor", 4, 0.15f);
mUseVert = !mUseVert;
break;
case "Orange":
if(mUseVert)
newAnimation.Load(mContent, "OrangeVert", 4, 0.15f);
else newAnimation.Load(mContent, "OrangeHor", 4, 0.15f);
mUseVert = !mUseVert;
break;
case "GreenDiamond":
newAnimation.Load(mContent, "GreenDiamond", 3, 0.225f);
break;
case "BlueDiamond":
newAnimation.Load(mContent, "BlueDiamond", 3, 0.225f);
break;
case "OrangeDiamond":
newAnimation.Load(mContent, "OrangeDiamond", 3, 0.225f);
break;
case "PinkDiamond":
newAnimation.Load(mContent, "PinkDiamond", 3, 0.225f);
break;
case "PurpleDiamond":
newAnimation.Load(mContent, "PurpleDiamond", 3, 0.225f);
break;
case "YellowDiamond":
newAnimation.Load(mContent, "YellowDiamond", 3, 0.225f);
break;
case "BlueGem":
newAnimation.Load(mContent, "BlueGem", 6, 0.15f);
break;
case "OrangeGem":
newAnimation.Load(mContent, "OrangeGem", 6, 0.15f);
break;
case "PinkGem":
newAnimation.Load(mContent, "PinkGem", 6, 0.15f);
break;
case "PurpleGem":
newAnimation.Load(mContent, "PurpleGem", 6, 0.15f);
break;
case "GreenGem":
newAnimation.Load(mContent, "GreenGem", 6, 0.15f);
break;
case "YellowGem":
newAnimation.Load(mContent, "YellowGem", 6, 0.15f);
break;
default:
newAnimation.Load(mContent, "NoAnimation", 1, 0.5f);
break;
}
return newAnimation;
}