我有一个包含播放,选项和退出按钮的主页,当我按照教程进行操作时,播放和退出按钮都可以使用,但是对于选项按钮,我不知道如何导航。我打算做的是创建另一个名为optionsMenu.cs的类,它具有学分屏幕或如何在其上播放指南。这些是我用于“选项”按钮的代码。
var optionsGameButton = new Button(buttonTexture, buttonFont)
{
Position = new Vector2(300, 250),
Text = "Options",
};
optionsGameButton.Click += OptionsGameButton_Click;
_components = new List<Component>()
{
titleGameButton,
playGameButton,
optionsGameButton,
exitGameButton,
};
最后,我知道我必须在此区域编写代码才能使选项按钮正常工作,但我不知道要放置哪种代码。
private void OptionsGameButton_Click(object sender, EventArgs e)
{
Console.WriteLine("Credits");
}