本文整理汇总了C#中Panel.AddChildLast方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.AddChildLast方法的具体用法?C# Panel.AddChildLast怎么用?C# Panel.AddChildLast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel.AddChildLast方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MenuScene
public MenuScene ()
{
this.Camera.SetViewFromViewport();
Sce.PlayStation.HighLevel.UI.Panel dialog = new Panel();
dialog.Width = Director.Instance.GL.Context.GetViewport().Width;
dialog.Height = Director.Instance.GL.Context.GetViewport().Height;
ImageBox ib = new ImageBox();
ib.Width = dialog.Width;
ib.Image = new ImageAsset("/Application/images/title.png", false);
ib.Height = dialog.Height;
ib.SetPosition(0.0f, 0.0f);
Button buttonPlay = new Button();
buttonPlay.Name = "buttonPlay";
buttonPlay.Text = "Play Game";
buttonPlay.Width = 300;
buttonPlay.Height = 50;
buttonPlay.Alpha = 0.8f;
buttonPlay.SetPosition(dialog.Width/2.0f - buttonPlay.Width/2.0f, 220.0f);
buttonPlay.TouchEventReceived += OnButtonPlay;
dialog.AddChildLast(ib);
dialog.AddChildLast(buttonPlay);
m_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
m_uiScene.RootWidget.AddChildLast(dialog);
UISystem.SetScene(m_uiScene);
Scheduler.Instance.ScheduleUpdateForTarget(this, 0, false);
}
示例2: SubmitScore
public SubmitScore ()
{
this.Camera.SetViewFromViewport();
Sce.PlayStation.HighLevel.UI.Panel dialog = new Panel();
dialog.Width = Director.Instance.GL.Context.GetViewport().Width;
dialog.Height = Director.Instance.GL.Context.GetViewport().Height;
//textInfo = new TextureInfo(m_texture);
//SpriteUV tScreen = new SpriteUV(textInfo);
//tScreen.Scale = textInfo.TextureSizef;
//tScreen.Pivot = new Vector2(0.5f,0.5f);
//tScreen.Position = new Vector2(Director.Instance.GL.Context.GetViewport().Width/2,
//Director.Instance.GL.Context.GetViewport().Height/2);
//this.AddChild(tScreen);
ImageBox ib = new ImageBox();
ib.Width = dialog.Width;
ib.Image = new ImageAsset("/Application/images/highScore.png", false);
ib.Height = dialog.Height;
ib.SetPosition(0.0f, 0.0f);
Button submitScore = new Button();
submitScore.Name = "submitScore";
submitScore.Text = "Submit Score";
submitScore.Width = 200;
submitScore.Height = 50;
submitScore.Alpha = 0.8f;
submitScore.SetPosition(250.0f, 40.0f);
submitScore.TouchEventReceived += OnSubmitScore;
Button returnToMenu = new Button();
returnToMenu.Name = "returnToMenu";
returnToMenu.Text = "Menu";
returnToMenu.Width = 200;
returnToMenu.Height = 50;
returnToMenu.Alpha = 0.8f;
returnToMenu.SetPosition(700.0f, 40.0f);
returnToMenu.TouchEventReceived += OnButtonPlay;
playerNameField = new EditableText();
playerNameField.Name = "playerNameField";
playerNameField.Width = 200;
playerNameField.Height = 50;
playerNameField.Alpha = 0.8f;
playerNameField.SetPosition(25.0f, 40.0f);
UpdateImage(totalScore);
dialog.AddChildLast(ib);
dialog.AddChildLast(submitScore);
dialog.AddChildLast(returnToMenu);
dialog.AddChildLast(playerNameField);
m_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
m_uiScene.RootWidget.AddChildLast(dialog);
UISystem.SetScene(m_uiScene);
Scheduler.Instance.ScheduleUpdateForTarget(this, 0, false);
}
示例3: MenuScene
public MenuScene()
{
this.Camera.SetViewFromViewport();
Panel dialog = new Panel();
dialog.Width = Director.Instance.GL.Context.GetViewport().Width;
dialog.Height = Director.Instance.GL.Context.GetViewport().Height;
ImageBox ib = new ImageBox();
ib.Width = dialog.Width;
ib.Image = new ImageAsset("/Application/images/title.png", false);
ib.Height = dialog.Height;
ib.SetPosition(0.0f, 0.0f);
Button playButton = new Button();
playButton.Name = "buttonPlay";
playButton.Text = "Play Game";
playButton.Width = 300;
playButton.Height = 50;
playButton.Alpha = 0.8f;
playButton.SetPosition(dialog.Width/2 - playButton.Width / 2, 200.0f);
playButton.TouchEventReceived += (sender, e) => {
Director.Instance.ReplaceScene(new GameScene());
};
Button menuButton = new Button();
menuButton.Name = "buttonMenu";
menuButton.Text = "Main Menu";
menuButton.Width = 300;
menuButton.Height = 50;
menuButton.Alpha = 0.8f;
menuButton.SetPosition(dialog.Width/2 - playButton.Width / 2, 250.0f);
menuButton.TouchEventReceived += (sender, e) => {
Director.Instance.ReplaceScene(new TitleScene());
};
dialog.AddChildLast(ib);
dialog.AddChildLast(playButton);
dialog.AddChildLast(menuButton);
_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
_uiScene.RootWidget.AddChildLast(dialog);
UISystem.SetScene(_uiScene);
Scheduler.Instance.ScheduleUpdateForTarget(this, 0, false);
}
示例4: LeaderBoard
public LeaderBoard (string scores)
{
highScores = scores;
this.Camera.SetViewFromViewport();
Sce.PlayStation.HighLevel.UI.Panel dialog = new Panel();
dialog.Width = Director.Instance.GL.Context.GetViewport().Width;
dialog.Height = Director.Instance.GL.Context.GetViewport().Height;
textInfo = new TextureInfo(m_texture);
SpriteUV tScreen = new SpriteUV(textInfo);
UpdateImage(highScores);
tScreen.Scale = textInfo.TextureSizef;
tScreen.Pivot = new Vector2(0.5f,0.5f);
tScreen.Position = new Vector2(Director.Instance.GL.Context.GetViewport().Width/2,
Director.Instance.GL.Context.GetViewport().Height/2);
this.AddChild(tScreen);
ImageBox ib = new ImageBox();
ib.Width = dialog.Width;
ib.Image = new ImageAsset("/Application/images/highScore.png", false);
ib.Height = dialog.Height;
ib.SetPosition(0.0f, 0.0f);
Button returnToMenu = new Button();
returnToMenu.Name = "returnToMenu";
returnToMenu.Text = "Menu";
returnToMenu.Width = 200;
returnToMenu.Height = 50;
returnToMenu.Alpha = 0.8f;
returnToMenu.SetPosition(700.0f, 40.0f);
returnToMenu.TouchEventReceived += OnButtonPlay;
dialog.AddChildLast(ib);
dialog.AddChildLast(returnToMenu);
m_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
m_uiScene.RootWidget.AddChildLast(dialog);
UISystem.SetScene(m_uiScene);
Scheduler.Instance.ScheduleUpdateForTarget(this, 0, false);
}
示例5: Initialize
public void Initialize()
{
Sce.PlayStation.HighLevel.UI.Panel dialog = new Panel();//create panel
dialog.Width = 960;//only for vita
dialog.Height = 544;
ImageBox ib = new ImageBox(); //set background images
ib.Width = dialog.Width;
ib.Image = new ImageAsset("/Application/resources/lose.png",false);
ib.Height = dialog.Height;
ib.SetPosition(0.0f,0.0f);
Button buttonUI1 = new Button(); //set buttons positions
buttonUI1.Name = "replay";
buttonUI1.Text = "replay";
buttonUI1.Width = 250;
buttonUI1.Height = 50;
buttonUI1.Alpha = 0.8f;
buttonUI1.SetPosition(dialog.Width/15,dialog.Height - 100);
buttonUI1.TouchEventReceived += (sender, e) => {
Support.SoundSystem.Instance.Play("ButtonClick.wav");
Director.Instance.ReplaceScene(new GameScene());
};
Button buttonUI2 = new Button();
buttonUI2.Name = "home";
buttonUI2.Text = "home";
buttonUI2.Width = 250;
buttonUI2.Height = 50;
buttonUI2.Alpha = 0.8f;
buttonUI2.SetPosition(dialog.Width/2.7f,dialog.Height - 100);
buttonUI2.TouchEventReceived += (sender, e) => {
Support.SoundSystem.Instance.Play("ButtonClick.wav");
Director.Instance.ReplaceScene(new MenuScene());
};
Sce.PlayStation.HighLevel.UI.Label scoreLabel = new Sce.PlayStation.HighLevel.UI.Label();
labelSetting(scoreLabel, //total score
"Total Score: " + GameScene.totalScore,
690,
0,
300,
100,
30,
FontStyle.Regular,
new UIColor(255, 0, 0, 255));
dialog.AddChildLast(ib);
dialog.AddChildLast(buttonUI1);
dialog.AddChildLast(buttonUI2);
dialog.AddChildLast(scoreLabel);
_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
_uiScene.RootWidget.AddChildLast(dialog);
UISystem.SetScene(_uiScene); // create menu scene
}
示例6: InitializeWidget
private void InitializeWidget(LayoutOrientation orientation)
{
Label_1 = new Label();
Label_1.Name = "Label_1";
Label_2 = new Label();
Label_2.Name = "Label_2";
Panel_1 = new Panel();
Panel_1.Name = "Panel_1";
// Label_1
Label_1.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
Label_1.Font = new UIFont(FontAlias.System, 72, FontStyle.Regular);
Label_1.LineBreak = LineBreak.Character;
// Label_2
Label_2.TextColor = new UIColor(41f / 255f, 226f / 255f, 226f / 255f, 255f / 255f);
Label_2.Font = new UIFont(FontAlias.System, 72, FontStyle.Bold);
Label_2.LineBreak = LineBreak.Character;
// Panel_1
Panel_1.BackgroundColor = new UIColor(30f / 255f, 30f / 255f, 30f / 255f, 255f / 255f);
Panel_1.Clip = true;
Panel_1.AddChildLast(Label_1);
Panel_1.AddChildLast(Label_2);
// levelInfo
this.RootWidget.AddChildLast(Panel_1);
SetWidgetLayout(orientation);
UpdateLanguage();
}
示例7: InitializeWidget
private void InitializeWidget(LayoutOrientation orientation)
{
ImageBox_1 = new ImageBox();
ImageBox_1.Name = "ImageBox_1";
ImageBox_2 = new ImageBox();
ImageBox_2.Name = "ImageBox_2";
ImageBox_3 = new ImageBox();
ImageBox_3.Name = "ImageBox_3";
ImageBox_4 = new ImageBox();
ImageBox_4.Name = "ImageBox_4";
ImageBox_5 = new ImageBox();
ImageBox_5.Name = "ImageBox_5";
ImageBox_6 = new ImageBox();
ImageBox_6.Name = "ImageBox_6";
currentTime = new Label();
currentTime.Name = "currentTime";
bestTime = new Label();
bestTime.Name = "bestTime";
vs = new Label();
vs.Name = "vs";
Panel_1 = new Panel();
Panel_1.Name = "Panel_1";
ImageBox_7 = new ImageBox();
ImageBox_7.Name = "ImageBox_7";
ImageBox_8 = new ImageBox();
ImageBox_8.Name = "ImageBox_8";
ImageBox_9 = new ImageBox();
ImageBox_9.Name = "ImageBox_9";
Panel_2 = new Panel();
Panel_2.Name = "Panel_2";
// ImageBox_1
ImageBox_1.Image = new ImageAsset("/Application/assets/new/newUI/hud/score.png");
ImageBox_1.ImageScaleType = ImageScaleType.Center;
// ImageBox_2
ImageBox_2.Image = new ImageAsset("/Application/assets/new/newUI/hud/goal.png");
ImageBox_2.ImageScaleType = ImageScaleType.Center;
// ImageBox_3
ImageBox_3.Image = new ImageAsset("/Application/assets/new/newUI/hud/hitMe.png");
ImageBox_3.ImageScaleType = ImageScaleType.Center;
// ImageBox_4
ImageBox_4.Image = new ImageAsset("/Application/assets/new/newUI/blueBox.png");
ImageBox_4.ImageScaleType = ImageScaleType.Center;
// ImageBox_5
ImageBox_5.Image = new ImageAsset("/Application/assets/new/newUI/redBox.png");
ImageBox_5.ImageScaleType = ImageScaleType.Center;
// ImageBox_6
ImageBox_6.Image = new ImageAsset("/Application/assets/new/newUI/timerIcon.png");
ImageBox_6.ImageScaleType = ImageScaleType.Center;
// currentTime
currentTime.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
currentTime.Font = new UIFont(FontAlias.System, 20, FontStyle.Regular);
currentTime.LineBreak = LineBreak.Character;
// bestTime
bestTime.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
bestTime.Font = new UIFont(FontAlias.System, 20, FontStyle.Regular);
bestTime.LineBreak = LineBreak.Character;
// vs
vs.TextColor = new UIColor(226f / 255f, 20f / 255f, 20f / 255f, 255f / 255f);
vs.Font = new UIFont(FontAlias.System, 25, FontStyle.Regular);
vs.LineBreak = LineBreak.Character;
// Panel_1
Panel_1.BackgroundColor = new UIColor(30f / 255f, 30f / 255f, 30f / 255f, 255f / 255f);
Panel_1.Clip = true;
Panel_1.AddChildLast(ImageBox_1);
Panel_1.AddChildLast(ImageBox_2);
Panel_1.AddChildLast(ImageBox_3);
Panel_1.AddChildLast(ImageBox_4);
Panel_1.AddChildLast(ImageBox_5);
Panel_1.AddChildLast(ImageBox_6);
Panel_1.AddChildLast(currentTime);
Panel_1.AddChildLast(bestTime);
Panel_1.AddChildLast(vs);
// ImageBox_7
ImageBox_7.Image = new ImageAsset("/Application/assets/new/newUI/quitBtn.png");
ImageBox_7.ImageScaleType = ImageScaleType.Center;
// ImageBox_8
ImageBox_8.Image = new ImageAsset("/Application/assets/new/newUI/levelSelect.png");
ImageBox_8.ImageScaleType = ImageScaleType.Center;
// ImageBox_9
ImageBox_9.Image = new ImageAsset("/Application/assets/new/newUI/nextLevel.png");
ImageBox_9.ImageScaleType = ImageScaleType.Center;
// Panel_2
Panel_2.BackgroundColor = new UIColor(30f / 255f, 30f / 255f, 30f / 255f, 255f / 255f);
Panel_2.Clip = true;
Panel_2.AddChildLast(ImageBox_7);
Panel_2.AddChildLast(ImageBox_8);
//.........这里部分代码省略.........
示例8: InitializeWidget
private void InitializeWidget(LayoutOrientation orientation)
{
Button_1 = new Button();
Button_1.Name = "Button_1";
Panel_1 = new Panel();
Panel_1.Name = "Panel_1";
Button_2 = new Button();
Button_2.Name = "Button_2";
Panel_2 = new Panel();
Panel_2.Name = "Panel_2";
Button_3 = new Button();
Button_3.Name = "Button_3";
Panel_3 = new Panel();
Panel_3.Name = "Panel_3";
Button_4 = new Button();
Button_4.Name = "Button_4";
Panel_4 = new Panel();
Panel_4.Name = "Panel_4";
Button_5 = new Button();
Button_5.Name = "Button_5";
Panel_5 = new Panel();
Panel_5.Name = "Panel_5";
Button_6 = new Button();
Button_6.Name = "Button_6";
Panel_6 = new Panel();
Panel_6.Name = "Panel_6";
Button_7 = new Button();
Button_7.Name = "Button_7";
Panel_7 = new Panel();
Panel_7.Name = "Panel_7";
Button_8 = new Button();
Button_8.Name = "Button_8";
Panel_8 = new Panel();
Panel_8.Name = "Panel_8";
Button_9 = new Button();
Button_9.Name = "Button_9";
Panel_9 = new Panel();
Panel_9.Name = "Panel_9";
Button_10 = new Button();
Button_10.Name = "Button_10";
Panel_10 = new Panel();
Panel_10.Name = "Panel_10";
Button_11 = new Button();
Button_11.Name = "Button_11";
Panel_11 = new Panel();
Panel_11.Name = "Panel_11";
Button_12 = new Button();
Button_12.Name = "Button_12";
Panel_12 = new Panel();
Panel_12.Name = "Panel_12";
// Button_1
Button_1.IconImage = null;
Button_1.Style = ButtonStyle.Custom;
Button_1.CustomImage = new CustomButtonImageSettings()
{
BackgroundNormalImage = new ImageAsset("/Application/assets/images/UI/cubeUI6.png"),
BackgroundPressedImage = new ImageAsset("/Application/assets/images/UI/cubeUIRollOver6.png"),
BackgroundDisabledImage = null,
BackgroundNinePatchMargin = new NinePatchMargin(0, 0, 0, 0),
};
Button_1.BackgroundFilterColor = new UIColor(226f / 255f, 20f / 255f, 20f / 255f, 255f / 255f);
// Panel_1
Panel_1.BackgroundColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
Panel_1.Clip = true;
Panel_1.AddChildLast(Button_1);
// Button_2
Button_2.IconImage = null;
Button_2.Style = ButtonStyle.Custom;
Button_2.CustomImage = new CustomButtonImageSettings()
{
BackgroundNormalImage = new ImageAsset("/Application/assets/images/UI/cubeUI6.png"),
BackgroundPressedImage = new ImageAsset("/Application/assets/images/UI/cubeUIRollOver6.png"),
BackgroundDisabledImage = null,
BackgroundNinePatchMargin = new NinePatchMargin(0, 0, 0, 0),
};
Button_2.BackgroundFilterColor = new UIColor(206f / 255f, 255f / 255f, 0f / 255f, 255f / 255f);
// Panel_2
Panel_2.BackgroundColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
Panel_2.Clip = true;
Panel_2.AddChildLast(Button_2);
// Button_3
Button_3.IconImage = null;
Button_3.Style = ButtonStyle.Custom;
Button_3.CustomImage = new CustomButtonImageSettings()
{
BackgroundNormalImage = new ImageAsset("/Application/assets/images/UI/cubeUI6.png"),
BackgroundPressedImage = new ImageAsset("/Application/assets/images/UI/cubeUIRollOver6.png"),
BackgroundDisabledImage = null,
BackgroundNinePatchMargin = new NinePatchMargin(0, 0, 0, 0),
};
Button_3.BackgroundFilterColor = new UIColor(206f / 255f, 244f / 255f, 226f / 255f, 255f / 255f);
// Panel_3
Panel_3.BackgroundColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
Panel_3.Clip = true;
//.........这里部分代码省略.........
示例9: MenuScene
public MenuScene()
{
Console.WriteLine("--------- menu scene -------");
this.Camera.SetViewFromViewport();//set camera view point
Sce.PlayStation.HighLevel.UI.Panel dialog = new Panel();//create panel
dialog.Width = Director.Instance.GL.Context.GetViewport().Width;
dialog.Height = Director.Instance.GL.Context.GetViewport().Height;
ImageBox ib = new ImageBox(); //set background images
ib.Width = dialog.Width;
ib.Image = new ImageAsset("/Application/resources/menuScene.png",false);
ib.Height = dialog.Height;
ib.SetPosition(0.0f,0.0f);
Button buttonUI1 = new Button(); //set buttons positions
buttonUI1.Name = "buttonPlay";
buttonUI1.Text = "Play Game";
buttonUI1.Width = 250;
buttonUI1.Height = 50;
buttonUI1.Alpha = 0.8f;
buttonUI1.SetPosition(dialog.Width/15,dialog.Height - 100);
buttonUI1.TouchEventReceived += (sender, e) => {
Support.SoundSystem.Instance.Play("ButtonClick.wav");
Director.Instance.ReplaceScene(new GameScene());
};
Button buttonUI2 = new Button();
buttonUI2.Name = "buttonOption";
buttonUI2.Text = "Option";
buttonUI2.Width = 250;
buttonUI2.Height = 50;
buttonUI2.Alpha = 0.8f;
buttonUI2.SetPosition(dialog.Width/2.7f,dialog.Height - 100);
buttonUI2.TouchEventReceived += (sender, e) => {
Support.SoundSystem.Instance.Play("ButtonClick.wav");
Director.Instance.ReplaceScene(new OptionScene());
};
Button buttonUI3 = new Button();
buttonUI3.Name = "buttonCredit";
buttonUI3.Text = "Credit";
buttonUI3.Width = 250;
buttonUI3.Height = 50;
buttonUI3.Alpha = 0.8f;
buttonUI3.SetPosition(dialog.Width/1.5f,dialog.Height - 100);
buttonUI3.TouchEventReceived += (sender, e) => {
Support.SoundSystem.Instance.Play("ButtonClick.wav");
Director.Instance.ReplaceScene(new CreditScene());
};
dialog.AddChildLast(ib);
dialog.AddChildLast(buttonUI1);
dialog.AddChildLast(buttonUI2);
dialog.AddChildLast(buttonUI3);
_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
_uiScene.RootWidget.AddChildLast(dialog);
UISystem.SetScene(_uiScene); // create menu scene
Scheduler.Instance.ScheduleUpdateForTarget(this,0,false); //run the loop
}
示例10: InitializeWidget
private void InitializeWidget(LayoutOrientation orientation)
{
Panel_1 = new Panel();
Panel_1.Name = "Panel_1";
label1 = new Label();
label1.Name = "label1";
connectToServerButton = new Button();
connectToServerButton.Name = "connectToServerButton";
textboxIPAddress = new EditableText();
textboxIPAddress.Name = "textboxIPAddress";
isConnected = new Label();
isConnected.Name = "isConnected";
connectedResults = new Label();
connectedResults.Name = "connectedResults";
Label_1 = new Label();
Label_1.Name = "Label_1";
// MainWindow
this.RootWidget.AddChildLast(Panel_1);
this.RootWidget.AddChildLast(Label_1);
// Panel_1
Panel_1.BackgroundColor = new UIColor(153f / 255f, 153f / 255f, 153f / 255f, 255f / 255f);
Panel_1.Clip = true;
Panel_1.AddChildLast(label1);
Panel_1.AddChildLast(connectToServerButton);
Panel_1.AddChildLast(textboxIPAddress);
Panel_1.AddChildLast(isConnected);
Panel_1.AddChildLast(connectedResults);
// label1
label1.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
label1.Font = new UIFont(FontAlias.System, 25, FontStyle.Regular);
label1.LineBreak = LineBreak.Character;
// connectToServerButton
connectToServerButton.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
connectToServerButton.TextFont = new UIFont(FontAlias.System, 25, FontStyle.Regular);
// textboxIPAddress
textboxIPAddress.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
textboxIPAddress.Font = new UIFont(FontAlias.System, 25, FontStyle.Regular);
textboxIPAddress.LineBreak = LineBreak.Character;
// isConnected
isConnected.TextColor = new UIColor(255f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
isConnected.Font = new UIFont(FontAlias.System, 25, FontStyle.Regular);
isConnected.LineBreak = LineBreak.Character;
// connectedResults
connectedResults.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
connectedResults.Font = new UIFont(FontAlias.System, 25, FontStyle.Regular);
connectedResults.LineBreak = LineBreak.Character;
// Label_1
Label_1.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
Label_1.Font = new UIFont(FontAlias.System, 25, FontStyle.Regular);
Label_1.LineBreak = LineBreak.Character;
SetWidgetLayout(orientation);
UpdateLanguage();
}
示例11: InitializeWidget
private void InitializeWidget(LayoutOrientation orientation)
{
ImageBox_2 = new ImageBox();
ImageBox_2.Name = "ImageBox_2";
ScoreText = new Label();
ScoreText.Name = "ScoreText";
ImageBox_1 = new ImageBox();
ImageBox_1.Name = "ImageBox_1";
TimerSeparatorText = new Label();
TimerSeparatorText.Name = "TimerSeparatorText";
TimerSecondsText = new Label();
TimerSecondsText.Name = "TimerSecondsText";
TimerMinutesText = new Label();
TimerMinutesText.Name = "TimerMinutesText";
Panel_1 = new Panel();
Panel_1.Name = "Panel_1";
PauseMenuText = new Label();
PauseMenuText.Name = "PauseMenuText";
ResumeButton = new Button();
ResumeButton.Name = "ResumeButton";
GiveUpButton = new Button();
GiveUpButton.Name = "GiveUpButton";
PauseMenu = new Panel();
PauseMenu.Name = "PauseMenu";
NextLevelButton = new Button();
NextLevelButton.Name = "NextLevelButton";
// ImageBox_2
ImageBox_2.Image = new ImageAsset("/Application/assets/images/UI/score_now.png");
ImageBox_2.ImageScaleType = ImageScaleType.Center;
// ScoreText
ScoreText.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
ScoreText.Font = new UIFont(FontAlias.System, 18, FontStyle.Bold);
ScoreText.LineBreak = LineBreak.Character;
// ImageBox_1
ImageBox_1.Image = new ImageAsset("/Application/assets/images/UI/time_now.png");
ImageBox_1.ImageScaleType = ImageScaleType.Center;
// TimerSeparatorText
TimerSeparatorText.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
TimerSeparatorText.Font = new UIFont(FontAlias.System, 18, FontStyle.Bold);
TimerSeparatorText.TextTrimming = TextTrimming.None;
TimerSeparatorText.LineBreak = LineBreak.Character;
TimerSeparatorText.HorizontalAlignment = HorizontalAlignment.Center;
// TimerSecondsText
TimerSecondsText.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
TimerSecondsText.Font = new UIFont(FontAlias.System, 18, FontStyle.Bold);
TimerSecondsText.TextTrimming = TextTrimming.None;
TimerSecondsText.LineBreak = LineBreak.Character;
// TimerMinutesText
TimerMinutesText.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
TimerMinutesText.Font = new UIFont(FontAlias.System, 18, FontStyle.Bold);
TimerMinutesText.LineBreak = LineBreak.Character;
TimerMinutesText.HorizontalAlignment = HorizontalAlignment.Right;
// Panel_1
Panel_1.BackgroundColor = new UIColor(40f / 255f, 40f / 255f, 40f / 255f, 255f / 255f);
Panel_1.Clip = true;
Panel_1.AddChildLast(ImageBox_2);
Panel_1.AddChildLast(ScoreText);
Panel_1.AddChildLast(ImageBox_1);
Panel_1.AddChildLast(TimerSeparatorText);
Panel_1.AddChildLast(TimerSecondsText);
Panel_1.AddChildLast(TimerMinutesText);
// PauseMenuText
PauseMenuText.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
PauseMenuText.Font = new UIFont(FontAlias.System, 44, FontStyle.Regular);
PauseMenuText.LineBreak = LineBreak.Character;
// ResumeButton
ResumeButton.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
ResumeButton.TextFont = new UIFont(FontAlias.System, 25, FontStyle.Regular);
ResumeButton.Style = ButtonStyle.Custom;
ResumeButton.CustomImage = new CustomButtonImageSettings()
{
BackgroundNormalImage = new ImageAsset("/Application/assets/images/UI/blueBtn.png"),
BackgroundPressedImage = new ImageAsset("/Application/assets/images/UI/blueBtnOver.png"),
BackgroundDisabledImage = null,
BackgroundNinePatchMargin = new NinePatchMargin(42, 27, 42, 27),
};
ResumeButton.BackgroundFilterColor = new UIColor(41f / 255f, 226f / 255f, 226f / 255f, 255f / 255f);
// GiveUpButton
GiveUpButton.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
GiveUpButton.TextFont = new UIFont(FontAlias.System, 25, FontStyle.Regular);
GiveUpButton.Style = ButtonStyle.Custom;
GiveUpButton.CustomImage = new CustomButtonImageSettings()
{
BackgroundNormalImage = new ImageAsset("/Application/assets/images/UI/redBtn.png"),
BackgroundPressedImage = null,
BackgroundDisabledImage = null,
BackgroundNinePatchMargin = new NinePatchMargin(42, 27, 42, 27),
};
GiveUpButton.BackgroundFilterColor = new UIColor(229f / 255f, 19f / 255f, 19f / 255f, 255f / 255f);
//.........这里部分代码省略.........
示例12: addUI
private void addUI()
{
Panel panel = new Panel();
panel.Width = Director.Instance.GL.Context.GetViewport().Width;
panel.Height = Director.Instance.GL.Context.GetViewport().Height;
ImageBox backgroundImageBox = new ImageBox();
backgroundImageBox.Width = panel.Width;
backgroundImageBox.Height = panel.Height;
backgroundImageBox.SetPosition(0.0f,0.0f);
backgroundImageBox.Image = new ImageAsset(backgroundImagePath, false);
Button playButton = new Button();
playButton.Name = "Play Game";
playButton.Text = "Play Game";
playButton.Width = 300;
playButton.Height = 50;
playButton.Alpha = 0.8f;
playButton.SetPosition(panel.Width/2 - 150, 200.0f);
playButton.TouchEventReceived += (sender, e) => {
Director.Instance.ReplaceScene(new MainGameScene());
};
panel.AddChildLast(backgroundImageBox);
panel.AddChildLast(playButton);
this.uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
this.uiScene.RootWidget.AddChildLast(panel);
UISystem.SetScene(this.uiScene);
}
示例13: InitializeWidget
private void InitializeWidget(LayoutOrientation orientation)
{
ImageBox_1 = new ImageBox();
ImageBox_1.Name = "ImageBox_1";
Panel_1 = new Panel();
Panel_1.Name = "Panel_1";
Button_1 = new Button();
Button_1.Name = "Button_1";
ImageBox_2 = new ImageBox();
ImageBox_2.Name = "ImageBox_2";
ImageBox_3 = new ImageBox();
ImageBox_3.Name = "ImageBox_3";
// ImageBox_1
ImageBox_1.Image = new ImageAsset("/Application/assets/new/newUI/bestTimevsCurrentTime.png");
ImageBox_1.ImageScaleType = ImageScaleType.Center;
// Panel_1
Panel_1.BackgroundColor = new UIColor(30f / 255f, 30f / 255f, 30f / 255f, 255f / 255f);
Panel_1.Clip = true;
Panel_1.AddChildLast(ImageBox_1);
// Button_1
Button_1.IconImage = new ImageAsset("/Application/assets/new/newUI/quit.png");
Button_1.BackgroundFilterColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 0f / 255f);
// ImageBox_2
ImageBox_2.Image = new ImageAsset("/Application/assets/new/newUI/mainMenu.png");
ImageBox_2.ImageScaleType = ImageScaleType.Center;
// ImageBox_3
ImageBox_3.Image = new ImageAsset("/Application/assets/new/newUI/newsetup.png");
ImageBox_3.ImageScaleType = ImageScaleType.Center;
// won
this.RootWidget.AddChildLast(Panel_1);
this.RootWidget.AddChildLast(Button_1);
this.RootWidget.AddChildLast(ImageBox_2);
this.RootWidget.AddChildLast(ImageBox_3);
SetWidgetLayout(orientation);
UpdateLanguage();
}
示例14: OptionScene
public OptionScene()
{
Console.WriteLine("---- option scene ----");
this.Camera.SetViewFromViewport();
Sce.PlayStation.HighLevel.UI.Panel panel = new Panel();//create panel
panel.Width = Director.Instance.GL.Context.GetViewport().Width;
panel.Height = Director.Instance.GL.Context.GetViewport().Height;
Sce.PlayStation.HighLevel.UI.Label title_label = new Sce.PlayStation.HighLevel.UI.Label();//title label
Sce.PlayStation.HighLevel.UI.Label music_label = new Sce.PlayStation.HighLevel.UI.Label();//music label
Sce.PlayStation.HighLevel.UI.Label sound_label = new Sce.PlayStation.HighLevel.UI.Label();//sound label
labelSetting(title_label, //label name
"Option", //label content
panel.Width/10, //x position
10, //y position
250, //x size
100, //y size
64, //font size
FontStyle.Bold, //font style
new UIColor(0, 255, 0, 255)); //font color
labelSetting(music_label,
"Music :",
panel.Width/7,
panel.Height/5,
150,
100,
32,
FontStyle.Regular,
new UIColor(0, 255, 0, 255));
labelSetting(sound_label,
"Sound :",
panel.Width/7,
panel.Height/3f,
150,
100,
32,
FontStyle.Regular,
new UIColor(0, 255, 0, 255));
Sce.PlayStation.HighLevel.UI.CheckBox checkMusicButton = new CheckBox(); //music
checkMusicButton.Checked = isMusicCheckboxChanged;
checkMusicButton.SetPosition(panel.Width/3,panel.Height/4.5f);
checkMusicButton.SetSize(50,50);
checkMusicButton.CheckedChanged += HandleCheckMusicButtonCheckedChanged;
sliderForMusic = new Sce.PlayStation.HighLevel.UI.Slider();
sliderForMusic.SetPosition(panel.Width/2f,panel.Height/4.5f);
sliderForMusic.SetSize(200,50);
sliderForMusic.MinValue = 0;
sliderForMusic.MaxValue = 1;
sliderForMusic.Value = 0.5f;
sliderForMusic.ValueChanging += HandleSliderForMusicValueChanging;//end music
Sce.PlayStation.HighLevel.UI.CheckBox checkSoundButton = new CheckBox();//sound
checkSoundButton.Checked = isSoundCheckboxChanged;
checkSoundButton.SetPosition(panel.Width/3,panel.Height/2.5f);
checkSoundButton.SetSize(50,50);
checkSoundButton.CheckedChanged += HandleCheckSoundButtonCheckedChanged;
sliderForSound = new Sce.PlayStation.HighLevel.UI.Slider();
sliderForSound.SetPosition(panel.Width/2f,panel.Height/2.5f);
sliderForSound.SetSize(200,50);
sliderForSound.MinValue = 0;
sliderForSound.MaxValue = 1;
sliderForSound.Value = Support.SoundSystem.volumOfSound;
sliderForSound.ValueChanging += HandleSliderForSoundValueChanging;//end sound
Button buttonUI1 = new Button(); //buttons
buttonUI1.Name = "go back";
buttonUI1.Text = "go back";
buttonUI1.Width = 250;
buttonUI1.Height = 50;
buttonUI1.Alpha = 0.8f;
buttonUI1.SetPosition(panel.Width/5,panel.Height - 100);
buttonUI1.TouchEventReceived += (sender, e) => {
Support.SoundSystem.Instance.PlayNoClobber("ButtonClick.wav");
Director.Instance.ReplaceScene(new MenuScene());
};
Button buttonUI2 = new Button();
buttonUI2.Name = "reset";
buttonUI2.Text = "reset";
buttonUI2.Width = 250;
buttonUI2.Height = 50;
buttonUI2.Alpha = 0.8f;
buttonUI2.SetPosition(panel.Width/2f,panel.Height - 100);
buttonUI2.TouchEventReceived += (sender, e) => {
Support.SoundSystem.Instance.PlayNoClobber("ButtonClick.wav");
};
_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
panel.AddChildLast(title_label);//add widgets in panel
panel.AddChildLast(music_label);
panel.AddChildLast(sound_label);
panel.AddChildLast(checkMusicButton);
panel.AddChildLast(checkSoundButton);
//.........这里部分代码省略.........
示例15: InitializeWidget
private void InitializeWidget(LayoutOrientation orientation, StageID stageID)
{
ImageBox_1 = new ImageBox();
ImageBox_1.Name = "ImageBox_1";
Button_1 = new Button();
Button_1.Name = "Button_1";
Panel_1 = new Panel();
Panel_1.Name = "Panel_1";
Label_1 = new Label();
Label_1.Name = "Label_1";
Label_2 = new Label();
Label_2.Name = "Label_2";
// ImageBox_1
ImageBox_1.ImageScaleType = ImageScaleType.Center;
// Button_1
Button_1.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
Button_1.TextFont = new UIFont(FontAlias.System, 25, FontStyle.Regular);
// Panel_1
Panel_1.BackgroundColor = new UIColor(153f / 255f, 153f / 255f, 153f / 255f, 255f / 255f);
Panel_1.Clip = true;
Panel_1.AddChildLast(ImageBox_1);
Panel_1.AddChildLast(Button_1);
// Label_1
Label_1.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
Label_1.Font = new UIFont(FontAlias.System, 80, FontStyle.Bold);
Label_1.LineBreak = LineBreak.Character;
Label_1.HorizontalAlignment = HorizontalAlignment.Center;
Label_1.TextShadow = new TextShadowSettings()
{
Color = new UIColor(128f / 255f, 128f / 255f, 128f / 255f, 127f / 255f),
HorizontalOffset = 2f,
VerticalOffset = 2f,
};
// Label_2
Label_2.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
Label_2.Font = new UIFont(FontAlias.System, 50, FontStyle.Bold);
Label_2.LineBreak = LineBreak.Character;
Label_2.HorizontalAlignment = HorizontalAlignment.Center;
Label_2.TextShadow = new TextShadowSettings()
{
Color = new UIColor(128f / 255f, 128f / 255f, 128f / 255f, 127f / 255f),
HorizontalOffset = 2f,
VerticalOffset = 2f,
};
// PanelStage
this.BackgroundColor = new UIColor(153f / 255f, 153f / 255f, 153f / 255f, 255f / 255f);
this.Clip = true;
this.AddChildLast(Panel_1);
this.AddChildLast(Label_1);
this.AddChildLast(Label_2);
SetWidgetLayout(orientation);
Update(stageID);
}