本文整理汇总了C#中FSprite.SetElementByName方法的典型用法代码示例。如果您正苦于以下问题:C# FSprite.SetElementByName方法的具体用法?C# FSprite.SetElementByName怎么用?C# FSprite.SetElementByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSprite
的用法示例。
在下文中一共展示了FSprite.SetElementByName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
public override void Start()
{
transitionIn = InitScript.shouldPlayMenuTransition;
InitScript.inGame = false;
background = new Starfield(InitScript.bg1Pos,false);
Futile.stage.AddChild(background);
background2 = new Starfield(InitScript.bg2Pos, false);
Futile.stage.AddChild(background2);
menuBackground = new FSprite("MenuStatic.png");
menuBackground.scale = 2.0f;
menuBackground.x = 0;
if (InitScript.shouldPlayMenuTransition == true)
menuBackground.isVisible = false;
Futile.stage.AddChild(menuBackground);
menuAnims = new FSprite("Menutoplay6.png");
if (InitScript.shouldPlayMenuTransition == false)
menuAnims.SetElementByName("MenuAnim0.png");
menuAnims.scale = 2.0f;
menuAnims.x = 0;
//menuAnims.isVisible = false;
Futile.stage.AddChild(menuAnims);
btnInstructions = new FButton("InfoButton.png");
btnInstructions.x -= 1;
btnInstructions.y -= 126;
btnInstructions.scale = 2.0f;
if (InitScript.shouldPlayMenuTransition == true)
btnInstructions.isVisible = false;
Futile.stage.AddChild(btnInstructions);
btnCredits = new FButton("CreditsButton.png");
btnCredits.x -= 1;
btnCredits.y -= 166;
btnCredits.scale = 2.0f;
if (InitScript.shouldPlayMenuTransition == true)
btnCredits.isVisible = false;
Futile.stage.AddChild(btnCredits);
btnPlay = new FButton("PlayButton.png");
btnPlay.x = 0;
btnPlay.y = 0;
btnPlay.scale = 2.0f;
Futile.stage.AddChild(btnPlay);
InitScript.blackBar1.MoveToTop();
InitScript.blackBar2.MoveToTop();
btnInstructions.SignalRelease += HandleInfoButtonRelease;
btnCredits.SignalRelease += HandleCreditButtonRelease;
btnPlay.SignalRelease += HandlePlayButtonRelease;
Futile.instance.SignalUpdate += HandleUpdate;
}
示例2: Switch
public Switch(string doorName, string name, World world)
: base(new RXRect(0,0,7,7), world)
{
this.blocksOtherObjects = false;
this.doorName = doorName;
sprite = new FSprite("Button/button_01");
this.AddChild(sprite);
this.name = name;
if (C.Save.switchesActivated.Contains(this.name))
{
pressed = true;
sprite.SetElementByName("Button/button_02");
}
}
示例3: Start
// Use this for initialization
public override void Start()
{
transitionIn = true;
InitScript.inGame = false;
background = new Starfield(0,false);
Futile.stage.AddChild(background);
background2 = new Starfield(320 + 80, false);
Futile.stage.AddChild(background2);
menuBackground = new FSprite("MenuStatic.png");
menuBackground.scale = 2.0f;
menuBackground.x = 0;
menuBackground.isVisible = false;
Futile.stage.AddChild(menuBackground);
menuAnims = new FSprite("Menutoplay6.png");
menuAnims.scale = 2.0f;
menuAnims.x = 0;
Futile.stage.AddChild(menuAnims);
btnInstructions = new FButton("MenuButton.png");
btnInstructions.x -= 1;
btnInstructions.y -= 126;
btnInstructions.scale = 2.0f;
btnInstructions.isVisible = false;
Futile.stage.AddChild(btnInstructions);
btnGameCenter = new FButton("GCButton.png");
btnGameCenter.x -= 1;
btnGameCenter.y -= 166;
btnGameCenter.scale = 2.0f;
btnGameCenter.isVisible = false;
Futile.stage.AddChild(btnGameCenter);
//score stuffffff
digit1 = new FSprite("0.png");
digit1.scale = 2.0f;
digit1.x = -159.7772f + 180;
digit1.y = Futile.screen.halfHeight - 57;
Futile.stage.AddChild(digit1);
digit2 = new FSprite("0.png");
digit2.scale = 2.0f;
digit2.x = -159.7772f + 160;
digit2.y = Futile.screen.halfHeight - 57;
Futile.stage.AddChild(digit2);
digit3 = new FSprite("0.png");
digit3.scale = 2.0f;
digit3.x = -159.7772f + 140;
digit3.y = Futile.screen.halfHeight - 57;
Futile.stage.AddChild(digit3);
hsDigit1 = new FSprite("0.png");
hsDigit1.scale = 2.0f;
hsDigit1.x = -159.7772f + 180;
hsDigit1.y = Futile.screen.halfHeight - 123;
hsDigit1.isVisible = false;
Futile.stage.AddChild(hsDigit1);
hsDigit2 = new FSprite("0.png");
hsDigit2.scale = 2.0f;
hsDigit2.x = -159.7772f + 160;
hsDigit2.y = Futile.screen.halfHeight - 123;
hsDigit2.isVisible = false;
Futile.stage.AddChild(hsDigit2);
hsDigit3 = new FSprite("0.png");
hsDigit3.scale = 2.0f;
hsDigit3.x = -159.7772f + 140;
hsDigit3.y = Futile.screen.halfHeight - 123;
hsDigit3.isVisible = false;
Futile.stage.AddChild(hsDigit3);
flash = new FSprite("GameOverAnim0.png");
flash.scale = 2.0f;
flash.x = 0;
flash.isVisible = false;
Futile.stage.AddChild(flash);
btnPlay = new FButton("PlayButton.png");
btnPlay.x = 0;
btnPlay.y = 0;
btnPlay.scale = 2.0f;
Futile.stage.AddChild(btnPlay);
btnInstructions.SignalRelease += HandleInfoButtonRelease;
btnGameCenter.SignalRelease += HandleGCButtonRelease;
btnPlay.SignalRelease += HandlePlayButtonRelease;
Futile.instance.SignalUpdate += HandleUpdate;
//score things
if (InitScript.hsD1 == 0)
hsDigit1.SetElementByName("0.png");
else if (InitScript.hsD1 == 1)
hsDigit1.SetElementByName("1.png");
else if (InitScript.hsD1 == 2)
//.........这里部分代码省略.........
示例4: Start
void Start()
{
instance = this;
Go.defaultEaseType = EaseType.Linear;
Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;
bool isIPad = SystemInfo.deviceModel.Contains("iPad");
FutileParams fparams = new FutileParams(false, false, true, false);
fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f,"");
fparams.origin = new Vector2(0.5f, 0.5f);
fparams.targetFrameRate = 60;
Application.targetFrameRate = 60;
Futile.instance.Init(fparams);
Futile.atlasManager.LoadAtlas("Atlases/Sprites");
FTouchManager.shouldMouseEmulateTouch = true;
_stage = Futile.stage;
//I have to say, unity makes it mad easy to store stuff like highscores on the device
highScore = PlayerPrefs.GetInt("highscore", 0);
hsD1 = PlayerPrefs.GetInt("Digit1",0);
hsD2 = PlayerPrefs.GetInt("Digit2",0);
hsD3 = PlayerPrefs.GetInt("Digit3",0);
//the black bars are added to the ipad version only, since it's pixel art
//it doesn't scale in odd resolutions, so I just made the screen a better resolution essentially
//it's a pretty horrible hack, but this is the only way I could really think to do it
blackBar1 = new FSprite("blackbar.png");
if (isIPad == false)
blackBar1.SetElementByName("0.png");
blackBar1.x = -320;
blackBar1.scale = 2.0f;
Futile.stage.AddChild(blackBar1);
blackBar2 = new FSprite("blackbar.png");
if (isIPad == false)
blackBar2.SetElementByName("0.png");
blackBar2.x = 320;
blackBar2.scale = 2.0f;
Futile.stage.AddChild(blackBar2);
HandleResize();
ISoundManager.Start();
ISoundManager.PlayMusic();
//gamecenter stuff that unity reduces to like 3 lines
//very cool
Social.localUser.Authenticate(authCallback);
gotoMenu();
}