本文整理汇总了C#中FButton.SetColors方法的典型用法代码示例。如果您正苦于以下问题:C# FButton.SetColors方法的具体用法?C# FButton.SetColors怎么用?C# FButton.SetColors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FButton
的用法示例。
在下文中一共展示了FButton.SetColors方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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.");
}
}
}
示例4: InitArrows
// this creates all the arrows around the board and sets them up to be able to send their data when pressed and released
private void InitArrows()
{
for (int i = 0; i < tileMapWidth; i++) {
FButton arrowButtonUp = new FButton("arrow", "arrow", "click");
arrowButtonUp.SetPosition((i + 0.5f) * tileSize, (tileMapHeight + 0.5f) * tileSize);
arrowButtonUp.SetColors(Color.white, Color.red);
arrowButtonUp.data = new ArrowData(Direction.Up, i);
arrowButtonUp.SignalRelease += ArrowButtonReleased;
boardContainer.AddChild(arrowButtonUp);
FButton arrowButtonDown = new FButton("arrow", "arrow", "click");
arrowButtonDown.SetPosition((i + 0.5f) * tileSize, -0.5f * tileSize);
arrowButtonDown.SetColors(Color.white, Color.red);
arrowButtonDown.data = new ArrowData(Direction.Down, i);
arrowButtonDown.SignalRelease += ArrowButtonReleased;
arrowButtonDown.rotation = 180;
boardContainer.AddChild(arrowButtonDown);
}
for (int j = 0; j < tileMapHeight; j++) {
FButton arrowButtonRight = new FButton("arrow", "arrow", "click");
arrowButtonRight.SetPosition((tileMapWidth + 0.5f) * tileSize, (j + 0.5f) * tileSize);
arrowButtonRight.SetColors(Color.white, Color.red);
arrowButtonRight.data = new ArrowData(Direction.Right, j);
arrowButtonRight.SignalRelease += ArrowButtonReleased;
arrowButtonRight.rotation = 90;
boardContainer.AddChild(arrowButtonRight);
FButton arrowButtonLeft = new FButton("arrow", "arrow", "click");
arrowButtonLeft.SetPosition(-0.5f * tileSize, (j + 0.5f) * tileSize);
arrowButtonLeft.SetColors(Color.white, Color.red);
arrowButtonLeft.data = new ArrowData(Direction.Left, j);
arrowButtonLeft.SignalRelease += ArrowButtonReleased;
arrowButtonLeft.rotation = 270;
boardContainer.AddChild(arrowButtonLeft);
}
}