本文整理汇总了C#中FButton.AddLabel方法的典型用法代码示例。如果您正苦于以下问题:C# FButton.AddLabel方法的具体用法?C# FButton.AddLabel怎么用?C# FButton.AddLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FButton
的用法示例。
在下文中一共展示了FButton.AddLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public override void Start()
{
_startButton = new FButton("boton");
_startButton.AddLabel("font","Play!",new Color(0,0,20,1f));
_startButton.scale=2f;
_titleLabel = new FLabel("font","Super Futile Box");
_instLabel = new FLabel("font","- Move with Arrow keys \n - Press 'space' to jump \n - Down key to fast fall \n - Avoid enemies!!! \n \n Tune: Barymag #2 - 8 by Lukasz Sychowicz (X-Ray)");
AddChild(_startButton);
AddChild(_titleLabel);
AddChild(_instLabel);
_titleLabel.x = 0f;
_titleLabel.y = 100f;
_instLabel.x = 0f;
_instLabel.y = -150f;
_startButton.SignalRelease += HandleStartButtonRelease;
_startButton.x = 0f;
_startButton.y = 0f;
Go.to(_startButton, 0.5f, new TweenConfig().
setDelay(0.3f).
floatProp("scale",1.0f).
setEaseType(EaseType.BackOut));
}
示例2: Start
public override void Start()
{
// once play navigates away from home screen, don't play the intro when they return
Main.instance.playIntro = false;
FSprite background = new FSprite("viewport");
background.SetAnchor(0.0f, 0.0f);
AddChild(background);
string backButtonText = "Back";
string titleText = "About The Game";
if (Main.instance.gameFinished){
// Display end game messages
titleText = "The Ship Went Nuclear!";
_scoreLabel = new FLabel("Emulogic", "You Saved " + Main.instance.crewSaved + " Crew Members");
_scoreLabel.color = Color.black; // new Color(0.173f, 0.722f, 0.976f, 1.0f);
_scoreLabel.scale = 0.25f;
_scoreLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight / 2);
AddChild(_scoreLabel);
_againButton = new FButton("buttonWide");
_againButton.AddLabel("Emulogic","Play Again",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f)
_againButton.label.scale = 0.25f;
_againButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + 80);
AddChild(_againButton);
_againButton.SignalRelease += HandleAgainButtonRelease;
backButtonText = "Home";
} else {
// diplay generic message
}
_textLabel = new FLabel("Emulogic", titleText);
_textLabel.color = Color.black;
_textLabel.scale = 0.5f;
_textLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight * 2 / 3);
AddChild(_textLabel);
_quitButton = new FButton("buttonWide");
_quitButton.AddLabel("Emulogic",backButtonText,Color.black); //new Color(0.45f,0.25f,0.0f,1.0f)
_quitButton.label.scale = 0.25f;
_quitButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight);
AddChild(_quitButton);
_quitButton.SignalRelease += HandleQuitButtonRelease;
string about = "Game Designed and created by Jason Rendel,\nfor Ludum Dare 27. My first game jam ever!\nCreated for the 48 hour competition.\n\n ---- Tools ----\n Unity 3d - Futile - Gimp \nTexture Packer - Glyph Designer - CFXR\n\nFollow me @jasonrendel\nCheck out what else I'm up to at www.jasonrendel.com";
_scoreLabel = new FLabel("Emulogic", about);
_scoreLabel.color = Color.black;
_scoreLabel.scale = 0.20f;
_scoreLabel.SetPosition(Futile.screen.halfWidth, 200);
AddChild(_scoreLabel);
}
示例3: NewButton
public Tweener NewButton(float x, float y, string fontName, string text, string bgName)
{
var n = new FButton(bgName);
//n.sprite.isVisible = false;
n.AddLabel(fontName, text, Color.white);
n.sprite.scaleX = n.label.textRect.width/n.sprite.textureRect.width;
n.sprite.scaleY = n.label.textRect.height/n.sprite.textureRect.height;
return NewTweener(n, x, y);
}
示例4: TitlePage
public TitlePage()
{
_title = new FLabel("gamefont", "Xelda Prototype");
_title.y = 200;
_title.scale = 2f;
AddChild(_title);
_start = new FButton("start_up.png","start_down.png");
_start.AddLabel("gamefont","Start", Color.white);
AddChild(_start);
_start.SignalRelease += HandleManButtonPressed;
}
示例5: Start
public override void Start()
{
_back=new FButton("Futile_White","Futile_White",null,null);
_back.SetColors(new Color(0f,0f,1f),new Color(0f,0f,0.5f));
_back.AddLabel(Config.fontFile,"Next",Color.white);
_back.scaleX=6f;
_back.label.scaleX=0.5f/_back.scaleX;
_back.scaleY=2f;
_back.label.scaleY=0.5f/_back.scaleY;
_back.x=Futile.screen.halfWidth-_back.hitRect.width*_back.scaleX*0.5f;
_back.y=-Futile.screen.halfHeight+_back.hitRect.height*_back.scaleY*0.5f;
Futile.stage.AddChild(_back);
_back.SignalRelease+=HandleNextButtonRelease;
}
示例6: Start
public override void Start()
{
_background = new FSprite("Background.png");
AddChild(_background);
_againButton = new FButton("CircleButtonBG_normal.png", "CircleButtonBG_over.png", "Click");
_againButton.AddLabel("Cubano","AGAIN!",Color.white);
AddChild (_againButton);
_againButton.x = -Futile.screen.halfWidth+100;
_againButton.y = Futile.screen.halfHeight-100;
_againButton.SignalRelease += HandleStartButtonRelease;
this.alpha = 0.0f;
Go.to (this, 0.5f, new TweenConfig().floatProp("alpha",1.0f));
}
示例7: MStatView
public MStatView(MPlayerStat stat)
{
this.stat = stat;
stat.SignalChange += HandleStatChange;
AddChild(_title = new FLabel("Cubano", ""));
_title.anchorY = 0.0f;
_title.y = 27.0f;
_title.scale = 0.4f;
AddChild(_button = new FButton("SquareButtonBG_normal.png", "SquareButtonBG_over.png","Click"));
_button.AddLabel("Cubano", "", Color.white);
_button.label.text = "";
_button.label.scale = 0.75f;
_button.isEnabled = false;
_button.SignalRelease += HandleButtonClick;
HandleStatChange (stat);
}
示例8: Start
override public void Start()
{
_background = new FSprite("JungleClearBG");
AddChild(_background);
//this will scale the background up to fit the screen
//but it won't let it shrink smaller than 100%
_logoHolder = new FContainer();
AddChild (_logoHolder);
_logo = new FSprite("MainLogo");
_logoHolder.AddChild(_logo);
_startButton = new FButton("YellowButton_normal", "YellowButton_down", "YellowButton_over", "ClickSound");
_startButton.AddLabel("Franchise","START",new Color(0.45f,0.25f,0.0f,1.0f));
AddChild(_startButton);
_startButton.SignalRelease += HandleStartButtonRelease;
_logoHolder.scale = 0.0f;
Go.to(_logoHolder, 0.5f, new TweenConfig().
setDelay(0.1f).
floatProp("scale",1.0f).
setEaseType(EaseType.BackOut));
_startButton.scale = 0.0f;
Go.to(_startButton, 0.5f, new TweenConfig().
setDelay(0.3f).
floatProp("scale",1.0f).
setEaseType(EaseType.BackOut));
HandleResize(true); //force resize to position everything at the start
}
示例9: Start
public override void Start()
{
ShowTitle("Fractals fun\nClick to set random params");
newOne();
base.Start();
FButton button=new FButton("Futile_White","Futile_White",null,null);
button.SetColors(new Color(0f,0f,1f),new Color(0f,0f,0.5f));
button.AddLabel(Config.fontFile,"New tree",Color.white);
button.scaleX=8f;
button.label.scaleX=0.5f/button.scaleX;
button.scaleY=2f;
button.label.scaleY=0.5f/button.scaleY;
button.x=Futile.screen.halfWidth-button.hitRect.width*button.scaleX*0.5f;
button.y=Futile.screen.halfHeight-button.hitRect.height*button.scaleY*0.5f;
Futile.stage.AddChild(button);
button.SignalRelease+=HandleNewButtonRelease;
}
示例10: Start
public override void Start()
{
_background = new FSprite("Background.png");
AddChild(_background);
_logo = new FSprite("TitleLogo.png");
_logo.x += 10;
_logo.y -= 10;
AddChild(_logo);
_startButton = new FButton("CircleButtonBG_normal.png", "CircleButtonBG_over.png", "Click");
_startButton.AddLabel("Cubano","START!",Color.white);
_startButton.x = 0;
_startButton.y = -150.0f;
AddChild(_startButton);
_startButton.SignalRelease += HandleStartButtonRelease;
this.alpha = 0.0f;
Go.to (this, 0.5f, new TweenConfig().floatProp("alpha",1.0f));
}
示例11: build
public void build()
{
Futile.touchManager.AddSingleTouchTarget( this );
background = new FSprite( "blank" );
background.color = Color.white;
AddChild( background );
bunnyButton = new FButton( "YellowButton_normal", "YellowButton_down", "YellowButton_over" );
bunnyButton.AddLabel( "Franchise", "TEST 1", Color.white );
bunnyButton.SignalRelease += onBunnyClicked;
AddChild( bunnyButton );
benchButton = new FButton( "YellowButton_normal", "YellowButton_down", "YellowButton_over" );
benchButton.AddLabel( "Franchise", "TEST 2", Color.white );
benchButton.SignalRelease += onBenchClicked;
AddChild( benchButton );
pirateButton = new FButton( "YellowButton_normal", "YellowButton_down", "YellowButton_over" );
pirateButton.AddLabel( "Franchise", "TEST 3", Color.white );
pirateButton.SignalRelease += onPirateClicked;
AddChild( pirateButton );
}
示例12: ApplyStyles
protected void ApplyStyles(FButton button,Dictionary<string,string> attributes)
{
string val;
float fVal;
SetNodeScale(button,new Vector2(button.hitRect.width,button.hitRect.height),attributes);
fVal=1f;
FloatAttributeParam("scale","fbutton",attributes,ref fVal);
button.scaleX*=fVal;
button.scaleY*=fVal;
fVal=1f;
FloatAttributeParam("alpha","fbutton",attributes,ref fVal);
button.alpha=1f;
Color upColor=Futile.white;
Color downColor=Futile.white;
ColorAttributeParam("color-up","fbutton",attributes,ref upColor);
ColorAttributeParam("color-down","fbutton",attributes,ref downColor);
button.SetColors(upColor,downColor);
val=null;
StringAttributeParam("label","fbutton",attributes,ref val);
if (val!=null) {
Color labelColor=Futile.white;
ColorAttributeParam("label-color","fbutton",attributes,ref labelColor);
button.AddLabel(_fontName,val,labelColor);
fVal=-1f;
FloatAttributeParam("label-scale","fbutton",attributes,ref fVal);
if (fVal>=0f) {
button.label.scaleX*=fVal/button.scaleX;
button.label.scaleY*=fVal/button.scaleY;
}
button.label.x=(float)(Math.Round(button.label.x));
button.label.y=(float)(Math.Round(button.label.y));
}
val=null;
StringAttributeParam("data","fbutton",attributes,ref val);
button.data=val;
//action
string action=null;
StringAttributeParam("action","fbutton",attributes,ref action);
if (action!=null) {
if (_actionsDelegate!=null) {
_buttonActions.Add (button,action);
button.SignalRelease+=HandleButtonAction;
} else {
Debug.LogWarning("FPseudoHtmlText : fbutton created with an \"action\" attribute but actionsDelegate is null.");
}
}
}
示例13: addButton
FButton addButton(string name)
{
FButton button = new FButton(Futile.whiteElement.name);
button.AddLabel("Abstract", name, tone1);
button.sprite.alpha = 0;
button.scale *= 2.5f;
menuElements.Add(button);
return button;
}
示例14: Start
public override void Start()
{
Main.instance.crewSaved = 0;
Main.instance.gameFinished = false;
FSprite background = new FSprite("viewport");
background.SetAnchor(0.0f, 0.0f);
AddChild(background);
_introLabel = new FLabel("Emulogic", "");
_introLabel.color = Color.black; //Color.green; // new Color(0.173f, 0.722f, 0.976f, 1.0f);
_introLabel.scale = 0.2f;
_introLabel.SetAnchor(0.0f, 1.0f);
_introLabel.SetPosition(60, Futile.screen.height - 14);
AddChild(_introLabel);
_titleLabel = new FLabel("Emulogic", "");
_titleLabel.color = Color.black;
_titleLabel.scale = 1.0f;
_titleLabel.SetAnchor(0.0f, 1.0f);
_titleLabel.SetPosition(200, 550);
AddChild(_titleLabel);
_finalLabel = new FLabel("Emulogic", "");
_finalLabel.color = Color.black; //Color.green;
_finalLabel.scale = 0.2f;
_finalLabel.SetAnchor(0.0f, 1.0f);
_finalLabel.SetPosition(575, 400);
AddChild(_finalLabel);
if (!Main.instance.playIntro){
_introLabel.text = _introText;
_titleLabel.text = _titleText;
_finalLabel.text = _finalText;
}
_startButton = new FButton("buttonWide");
_startButton.AddLabel("Emulogic","Play!",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f)
_startButton.label.scale = 0.25f;
_startButton.SetPosition(Futile.screen.width - 225, 155);
AddChild(_startButton);
_startButton.SignalRelease += HandleStartButtonRelease;
_creditsButton = new FButton("buttonWide");
_creditsButton.AddLabel("Emulogic","About",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f)
_creditsButton.label.scale = 0.25f;
_creditsButton.SetPosition(Futile.screen.width - 225, 75);
AddChild(_creditsButton);
_creditsButton.SignalRelease += HandleCreditsButtonRelease;
_lastTextUpdate = Main.GameTime;
FSprite escapePod = new FSprite("escapePod");
FSprite doors = new FSprite("doorsIcon");
FSprite crew = new FSprite("floatingCharacter");
FSprite clock = new FSprite("moveTileIcon");
//FSprite clock = new FSprite("clock4");
escapePod.scale = 0.5f;
doors.scale = 0.5f;
escapePod.SetPosition(140, 305);
doors.SetPosition(140, 230);
crew.SetPosition(140, 155);
clock.SetPosition(140, 80);
AddChild(escapePod);
AddChild(doors);
AddChild(crew);
AddChild(clock);
FLabel escapePodLabel = new FLabel("Emulogic", "Get the crew to \nthe escape pods!");
escapePodLabel.color = Color.black; //Color.green;
escapePodLabel.scale = 0.15f;
escapePodLabel.SetAnchor(0.0f, 0.5f);
escapePodLabel.SetPosition(200, 305);
AddChild(escapePodLabel);
FLabel doorsLabel = new FLabel("Emulogic", "Touch doors to \nopen and close them.");
doorsLabel.color = Color.black; //Color.green;
doorsLabel.scale = 0.15f;
doorsLabel.SetAnchor(0.0f, 0.5f);
doorsLabel.SetPosition(200, 230);
AddChild(doorsLabel);
FLabel crewLabel = new FLabel("Emulogic", "The Crew. They will walk \nthrough open doors, \nbut don't expect much else.");
crewLabel.color = Color.black; //Color.green;
crewLabel.scale = 0.15f;
crewLabel.SetAnchor(0.0f, 0.5f);
crewLabel.SetPosition(200, 155);
AddChild(crewLabel);
FLabel clockLabel = new FLabel("Emulogic", "Place movement tiles \nto redirect the crew.");
//FLabel clockLabel = new FLabel("Emulogic", "10 Seconds.");
clockLabel.color = Color.black; //Color.green;
//.........这里部分代码省略.........
示例15: Start
public override void Start()
{
// once play navigates away from home screen, don't play the intro when they return
Main.instance.playIntro = false;
Main.instance.crewSaved = 0;
FSprite background = new FSprite("mainGameViewport");
background.SetAnchor(0.0f, 0.0f);
AddChild(background);
_levelManager = new LevelManager();
AddChild(_levelManager);
this.shouldSortByZ = true;
meltdownBar = new FSprite("meltdown");
meltdownBar.SetPosition(Futile.screen.halfWidth, 672);
AddChild(meltdownBar);
_closeButton = new FButton("button");
_closeButton.AddLabel("Emulogic","Quit",Color.black);
_closeButton.label.scale = 0.25f;
_closeButton.sortZ = 1;
_closeButton.SignalRelease += HandleCloseButtonRelease;
_closeButton.x = Futile.screen.width - 125.0f;
_closeButton.y = Futile.screen.height -75.0f;
AddChild(_closeButton);
Clock clock = new Clock();
clock.SetPosition( 75.0f, Futile.screen.height - 75.0f);
AddChild(clock);
crewSavedLabel = new FLabel("Emulogic", "Crew Members Saved: 0");
crewSavedLabel.SetPosition( Futile.screen.halfWidth, Futile.screen.height - 45.0f);
crewSavedLabel.scale = 0.25f;
AddChild(crewSavedLabel);
selectedInventory = new FSprite("inventorySelected");
selectedInventory.isVisible = false;
AddChild(selectedInventory);
//spawnInventory();
spawnCrew(2);
_lastCycle = Main.GameTime;
}