本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.Sprite.DisableClick方法的典型用法代码示例。如果您正苦于以下问题:C# Sprite.DisableClick方法的具体用法?C# Sprite.DisableClick怎么用?C# Sprite.DisableClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.Sprite
的用法示例。
在下文中一共展示了Sprite.DisableClick方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeGameOverSprites
private void InitializeGameOverSprites()
{
_gameOverSprite = new Sprite(this, "textures/gameOver");
_gameOverSprite.Hide();
_gameOverSprite.DisableClick();
_gameOverSprite.CenterHorizontally();
_gameOverSprite.CenterVertically();
AddComponent(_gameOverSprite, "Sprites");
_gameOverSprite.Click += (sender, e) => SceneManager.PlayPreviousScene();
}
示例2: Load
protected override void Load()
{
if (_hasBeenLoaded)
return;
_hasBeenLoaded = true;
AddGroup("Environment");
AddGroup("Models");
AddGroup("Sprites");
var camera = new MainMenuCamera(this, Camera.Default().Between(0.1f, 1000.0f).Wide(MathHelper.PiOver4));
AddComponent(camera);
SetCurrentCamera(camera);
AddComponent(new SkyGlobe(this, "models/SkyGlobeTexture", 200.0f), "Environment");
AddComponent(new Sprite(this, "textures/logo").FillScreen(), "Sprites");
_startGameMenuItem = new Sprite(this, "textures/startGame");
AddComponent(_startGameMenuItem, "Sprites");
_fadeOutAnimation = new TextureFadeAnimation(this,
"textures/blank",
BuildTransition.Between(1.0f, 0.0f)
.Within(TimeSpan.FromSeconds(0.5f))
.InterpolateWith(MathHelper.Lerp)
.Auditable()
.Instance());
AddComponent(_fadeOutAnimation, "Sprites");
_fadeInAnimation = new TextureFadeAnimation(this,
"textures/blank",
BuildTransition.Between(0.0f, 1.0f)
.Within(TimeSpan.FromSeconds(0.5f))
.InterpolateWith(MathHelper.SmoothStep)
.Auditable()
.Instance());
AddComponent(_fadeInAnimation, "Sprites");
_startGameMenuItem.Click += (sender, e) =>
{
_startGameMenuItem.DisableClick();
_fadeInAnimation.Start(SceneManager.PlayNextScene);
};
_startGameMenuItem.DisableClick()
.SetPosition(new Vector2(0.0f, 340.0f))
.CenterHorizontally();
base.Load();
}