本文整理汇总了C#中Button.ApplyStylishEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Button.ApplyStylishEffect方法的具体用法?C# Button.ApplyStylishEffect怎么用?C# Button.ApplyStylishEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Button
的用法示例。
在下文中一共展示了Button.ApplyStylishEffect方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScoreTable
public ScoreTable(Window parent, bool playing = true)
{
Playing = playing;
Size = new Vector(500, 300);
Location = new Vector(200, 100);
Visible = false;
closeButton = new Button();
closeButton.ApplyStylishEffect();
closeButton.Image = "data/img/bck.bmp";
closeButton.Location = new Vector(370, 350);
closeButton.Visible = false;
closeButton.Text = "Close";
closeButton.MouseClick += (pos) =>
{
Visible = false;
if (Playing)
Game.StartNextLevel();
};
parent.Children.Add(this);
parent.Children.Add(closeButton);
}
示例2: BetaVerification
public BetaVerification(GameWindow parent)
{
mainLabel = new Label();
mainLabel.Location = new Vector(350, 180);
mainLabel.Text = "Please enter your open beta key.";
nameBox = new TextBox();
nameBox.Location = new Vector(325, 220);
nameLabel = new Label();
nameLabel.Location = new Vector(315, 200);
nameLabel.Text = "Name:";
keyLabel = new Label();
keyLabel.Location = new Vector(325, 240);
keyLabel.Text = "Beta key:";
keyBox = new TextBox();
keyBox.Location = new Vector(300, 260);
keyBox.Size.X = 200;
verifyButton = new Button();
verifyButton.Location = new Vector(335, 290);
verifyButton.ApplyStylishEffect();
verifyButton.Image = "data/img/bck.bmp";
verifyButton.Text = "Verify";
verifyButton.MouseClick += (pos) =>
{
if (OpenBetaFunctions.VerifyBetaKey(nameBox.Text, keyBox.Text))
{
Parent.Children.Remove(nameBox);
Parent.Children.Remove(nameLabel);
Parent.Children.Remove(keyBox);
Parent.Children.Remove(keyLabel);
Parent.Children.Remove(verifyButton);
Parent.Children.Remove(wrongKeyMessage);
Parent.Children.Remove(mainLabel);
Settings.Default.CredentialsVerified = true;
Settings.Default.Save();
if (Settings.Default.MusicStatus)
BackgroundMusic.StartPlayback();
Parent.Menu = new MainMenu(Parent);
}
else wrongKeyMessage.Visible = true;
};
wrongKeyMessage = new Label();
wrongKeyMessage.Text = "The key and username do not match.";
wrongKeyMessage.Location = new Vector(340, 310);
wrongKeyMessage.Visible = false;
Parent = parent;
Parent.AddChildren(nameLabel, nameBox, mainLabel, keyLabel, keyBox, verifyButton, wrongKeyMessage);
}
示例3: MainMenu
public MainMenu(Window window)
{
ParentWindow = window;
skybox = new Skybox();
start = new Button();
start.ApplyStylishEffect();
//start.Location = new Vector()
}
示例4: InfoBox
/// <summary>
/// Initializes a new instance of the InfoBox class.
/// It flashes an exclamation mark 2 times, then moves
/// to the target location.
/// </summary>
/// <param name="parent"></param>
/// <param name="target"></param>
public InfoBox(Window parent, Vector target, string message)
{
CanBeMoved = true;
Location = new Vector(target.X, target.Y);
OKClicked = new MouseEventDel((pos) => { });
ExclamationClicked = new MouseEventDel((pos) => { });
ExclamationSize = new Vector(60, 55);
ExclamationLocation = new Vector((parent.Width - ExclamationSize.X) / 2,
(parent.Height - ExclamationSize.Y) / 2);
Size = new Vector(200, 10);
Parent = parent;
frameAlpha = 0f;
startAlpha = 0f;
currentAlpha = startAlpha;
frameTargetY = 200;
targetAlpha = 1f;
animationCoef = 0.0f;
mainLabel = new Label();
Message = message;
mainLabel.Location = new Vector(Location.X - 50 + message.Length * 4, Location.Y + 30);
mainLabel.Visible = false;
buttonOk = new Button();
buttonOk.Image = "data/img/bck.bmp";
buttonOk.ApplyStylishEffect();
buttonOk.Visible = false;
buttonOk.Size.X = 70;
buttonOk.Location = new Vector(Location.X + (Size.X - buttonOk.Size.X) / 2, Location.Y + 160);
buttonOk.Text = "OK";
buttonOk.MouseClick += (pos) =>
{
OKClicked.Invoke(pos);
Parent.Children.Remove(buttonOk);
Parent.Children.Remove(mainLabel);
Parent.Children.Remove(this);
MainTimer.Stop();
};
Parent.Mouse.Move += MouseMoveFunc;
targetLocation = target;
targetLocation.X += Size.X / 2;
targetLocation.Y += Size.Y / 2;
MainTimer = new Timer();
MainTimer.Interval = 10;
MainTimer.Tick += AnimationStep;
MainTimer.Start();
}
示例5: IngameMenu
public IngameMenu(GameWindow parent)
{
Parent = parent;
Visible = false;
float shift = 30;
float x = parent.Width / 2;
float y = parent.Height / 2;
resume = new Button();
resume.ApplyStylishEffect();
resume.Location = new Vector(x - resume.Size.X, y - shift * 3);
resume.Text = "Resume";
resume.Visible = false;
resume.MouseClick += (pos) =>
{
Hide();
Parent.State = Window.WindowState.Game;
};
settings = new Button();
settings.ApplyStylishEffect();
settings.Location = new Vector(x - settings.Size.X + 7, y - shift * 2);
settings.Text = "Settings";
settings.Visible = false;
settings.MouseClick += (pos) =>
{
};
quit = new Button();
quit.ApplyStylishEffect();
quit.Location = new Vector(x - quit.Size.X, y - shift);
quit.Text = "Quit";
quit.Visible = false;
quit.MouseClick += (pos) =>
{
Game.Game.QuitLevel();
Parent.Menu.RenderVisibility(true);
Hide();
};
Parent.AddChildren(resume, settings, quit, this);
}
示例6: Credits
public Credits(MainMenu parent)
{
ParentMenu = parent;
credit = new Label();
credit.Text = " Credits \n\nProgrammers \n Traiko Dinev \n\nGame Designer"+
"\n Traiko Dinev \n\nLead Programmer \n Traiko Dinev";
back = new Button();
back.ApplyStylishEffect();
back.Image = "data/img/bck.bmp";
back.Text = "Return";
back.Size.X = 80;
back.MouseClick += (pos) =>
{
Visible = false;
};
Visible = false;
Initialize();
ParentMenu.ParentWindow.AddChildren(this, back);
LogManager.WriteInfo("Created credits menu.");
}
示例7: SettingsMenu
public SettingsMenu(MainMenu MenuParent)
{
Parent = MenuParent.ParentWindow;
ParentMenu = MenuParent;
soundStatus = Properties.Settings.Default.SoundStatus;
musicStatus = Properties.Settings.Default.MusicStatus;
mainTimer = new Timer();
mainTimer.Interval = 10;
titleLabel = new Label();
titleLabel.Text = "Settings";
titleLabel.Location = new Vector(100, -250.5f);
toggleSoundLabel = new Label();
toggleSoundLabel.Location = new Vector(130, -220.5f);
toggleSoundLabel.Text = "Sound: " + (soundStatus ? "On " : "Off");
toggleSound = new Button();
toggleSound.Location = new Vector(270, -220.5f);
toggleSound.ApplyStylishEffect();
toggleSound.Size = new Vector(70, 20);
toggleSound.Image = "data/img/bck.bmp";
toggleSound.Text = "Toggle";
toggleSound.MouseClick += (pos) =>
{
soundStatus = soundStatus ? false : true;
toggleSoundLabel.Text = "Sound: " + (soundStatus ? "On " : "Off");
};
saveButton = new Button();
saveButton.Location = new Vector(200, -30);
saveButton.Image = "data/img/bck.bmp";
saveButton.ApplyStylishEffect();
saveButton.Text = "Save";
saveButton.MouseClick += (pos) => SaveAndHide();
toggleMusicLabel = new Label();
toggleMusicLabel.Location = new Vector(130, -180.5f);
toggleMusicLabel.Text = "Music: " + (musicStatus ? "On " : "Off");
toggleMusic = new Button();
toggleMusic.Location = new Vector(270, -180.5f);
toggleMusic.ApplyStylishEffect();
toggleMusic.Size = new Vector(70, 20);
toggleMusic.Image = "data/img/bck.bmp";
toggleMusic.Text = "Toggle";
toggleMusic.MouseClick += (pos) =>
{
musicStatus = musicStatus ? false : true;
toggleMusicLabel.Text = "Music: " + (musicStatus ? "On " : "Off");
};
deleteSaveGames = new Button();
deleteSaveGames.Location = new Vector(150, -120.5f);
deleteSaveGames.ApplyStylishEffect();
deleteSaveGames.Image = "data/img/bck.bmp";
deleteSaveGames.Text = "Delete saved games";
deleteSaveGames.MouseClick += (pos) =>
{
Game.Game.DeleteProgress(false);
Game.Game.LoadGame();
SaveAndHide();
};
deleteSaveGames.Size = new Vector(160, 25);
Parent.AddChildren(toggleSound, saveButton, toggleMusicLabel, toggleMusic, deleteSaveGames);
mainTimer.Tick += (o, e) =>
{
//lazy delay implementation
//TODO: maybe fix
elapsed++;
if (elapsed < 10)
return;
if (curShift < destShift)
{
curShift += shiftIncr;
titleLabel.Location.Y -= curShift;
toggleSoundLabel.Location.Y -= curShift;
toggleSound.Location.Y -= curShift;
saveButton.Location.Y -= curShift;
toggleMusicLabel.Location.Y -= curShift;
toggleMusic.Location.Y -= curShift;
deleteSaveGames.Location.Y -= curShift;
return;
}
mainTimer.Stop();
};
}
示例8: PlayGameMenu
public PlayGameMenu(MainMenu menuParent)
{
MenuParent = menuParent;
Parent = menuParent.ParentWindow;
resumeGameButton = new Button();
resumeGameButton.Text = "Resume Game";
resumeGameButton.Location = new Vector(255, 0);
resumeGameButton.ApplyStylishEffect();
resumeGameButton.Size.X -= 10;
resumeGameButton.Image = "data/img/bck.bmp";
resumeGameButton.MouseClick += (pos) =>
{
Game.Game.ResumeGame();
Hide();
MenuParent.HideMenu();
};
newGameButton = new Button();
newGameButton.Text = "New Game";
newGameButton.Location = new Vector(250, 0);
newGameButton.ApplyStylishEffect();
newGameButton.Image = "data/img/bck.bmp";
newGameButton.MouseClick += (pos) =>
{
Game.Game.NewGame();
Hide();
MenuParent.HideMenu();
};
backButton = new Button();
backButton.Text = "Back";
backButton.Location = new Vector(265, 0);
backButton.ApplyStylishEffect();
backButton.Image = "data/img/bck.bmp";
backButton.Size.X -= 30;
backButton.MouseClick += (pos) => Hide();
mainTimer = new Timer();
mainTimer.Interval = 10;
mainTimer.Tick += (o, e) =>
{
if (curShift < destShift)
{
curShift += shiftIncr;
resumeGameButton.Location.Y -= curShift;
newGameButton.Location.Y -= curShift;
backButton.Location.Y -= curShift;
return;
}
mainTimer.Stop();
};
resumeGameButton.Location.Y = -250.5f;
newGameButton.Location.Y = -220.5f;
backButton.Location.Y = -1900.5f;
Parent.AddChildren(resumeGameButton, newGameButton, backButton);
canResume = Game.Game.CheckProgress();
if (!canResume)
{
Parent.Children.Remove(resumeGameButton);
Parent.Children.Add(this);
}
}