-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
107 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,5 @@ public enum LocalizationStrings { | |
GMLTest, | ||
TexturePackerTest, | ||
BoxBlurTest, | ||
TextureFadeTest | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Numerics; | ||
using Furball.Engine; | ||
using Furball.Engine.Engine.Graphics; | ||
using Furball.Engine.Engine.Graphics.Drawables; | ||
using Furball.Engine.Engine.Graphics.Drawables.UiElements; | ||
using Furball.Engine.Engine.Input.Events; | ||
using Furball.Vixie; | ||
using Furball.Vixie.Backends.Shared; | ||
using Furball.Vixie.Backends.Shared.TextureEffects.Blur; | ||
|
||
namespace Furball.Game.Screens.Tests; | ||
|
||
public class TextureFadeTest : TestScreen { | ||
private TexturedDrawable _textureDrawable; | ||
private Texture _source; | ||
private BoxBlurTextureEffect _blur; | ||
private Texture _dest; | ||
|
||
public override void Initialize() { | ||
base.Initialize(); | ||
|
||
this._source = ContentManager.LoadTextureFromFileCached("inviswater.png"); | ||
this._blur = FurballGame.Instance.WindowManager.GraphicsBackend.CreateBoxBlurTextureEffect(this._source); | ||
this._dest = new Texture(this._blur.Texture); | ||
this._blur.UpdateTexture(); | ||
|
||
this.Manager.Add(this._textureDrawable = new TexturedDrawable(this._source, new Vector2(10))); | ||
|
||
this.Manager.Add( | ||
new DrawableButton(new Vector2(10), FurballGame.DefaultFont, 24, "Fade texture", Color.Blue, Color.White, Color.Black, Vector2.Zero, FadeTexture) { | ||
ScreenOriginType = OriginType.TopRight, | ||
OriginType = OriginType.TopRight | ||
} | ||
); | ||
} | ||
|
||
private void FadeTexture(object sender, MouseButtonEventArgs e) { | ||
this._textureDrawable.FadeTexture(this._textureDrawable.Texture == this._source ? this._dest : this._source, 1000); | ||
} | ||
} |
Submodule Furball.Vixie
updated
15 files