本文整理匯總了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();
}