summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DungeonSlime/Content/Content.mgcb6
-rwxr-xr-xDungeonSlime/Content/Music.fx35
-rw-r--r--DungeonSlime/Game1.cs55
3 files changed, 92 insertions, 4 deletions
diff --git a/DungeonSlime/Content/Content.mgcb b/DungeonSlime/Content/Content.mgcb
index 08a7c33..0c3469d 100644
--- a/DungeonSlime/Content/Content.mgcb
+++ b/DungeonSlime/Content/Content.mgcb
@@ -13,6 +13,12 @@
#---------------------------------- Content ---------------------------------#
+#begin ../../../../Music/output/learning.wav
+/importer:WavImporter
+/processor:SongProcessor
+/processorParam:Quality=Best
+/build:../../../../Music/output/learning.wav;Music/learning.wav
+
#begin Images/logo.png
/importer:TextureImporter
/processor:TextureProcessor
diff --git a/DungeonSlime/Content/Music.fx b/DungeonSlime/Content/Music.fx
new file mode 100755
index 0000000..2eb340a
--- /dev/null
+++ b/DungeonSlime/Content/Music.fx
@@ -0,0 +1,35 @@
+#if OPENGL
+ #define SV_POSITION POSITION
+ #define VS_SHADERMODEL vs_3_0
+ #define PS_SHADERMODEL ps_3_0
+#else
+ #define VS_SHADERMODEL vs_4_0_level_9_1
+ #define PS_SHADERMODEL ps_4_0_level_9_1
+#endif
+
+Texture2D SpriteTexture;
+
+sampler2D SpriteTextureSampler = sampler_state
+{
+ Texture = <SpriteTexture>;
+};
+
+struct VertexShaderOutput
+{
+ float4 Position : SV_POSITION;
+ float4 Color : COLOR0;
+ float2 TextureCoordinates : TEXCOORD0;
+};
+
+float4 MainPS(VertexShaderOutput input) : COLOR
+{
+ return tex2D(SpriteTextureSampler,input.TextureCoordinates) * input.Color;
+}
+
+technique SpriteDrawing
+{
+ pass P0
+ {
+ PixelShader = compile PS_SHADERMODEL MainPS();
+ }
+}; \ No newline at end of file
diff --git a/DungeonSlime/Game1.cs b/DungeonSlime/Game1.cs
index 1594151..879b96a 100644
--- a/DungeonSlime/Game1.cs
+++ b/DungeonSlime/Game1.cs
@@ -1,12 +1,15 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
+
using MonoGameLibrary;
namespace DungeonSlime;
public class Game1 : Core
{
+ private Texture2D _logo;
+
public Game1(): base("Dungeon Slime", 1280, 720, false)
{
@@ -14,14 +17,12 @@ public class Game1 : Core
protected override void Initialize()
{
- // TODO: Add your initialization logic here
-
base.Initialize();
}
protected override void LoadContent()
{
- // TODO: use this.Content to load your game content here
+ _logo = Content.Load<Texture2D>("Images/logo");
}
protected override void Update(GameTime gameTime)
@@ -38,7 +39,53 @@ public class Game1 : Core
{
GraphicsDevice.Clear(Color.CornflowerBlue);
- // TODO: Add your drawing code here
+ Rectangle iconSourceRect = new Rectangle(0, 0,128, 128);
+ Rectangle wordmarkSourceRect = new Rectangle(150, 34, 458, 58);
+
+ SpriteBatch.Begin(
+ sortMode: SpriteSortMode.BackToFront,
+ samplerState: SamplerState.LinearWrap
+ );
+
+ //Draw only icon portion
+ SpriteBatch.Draw(
+ _logo,
+ new Vector2(
+ Window.ClientBounds.Width,
+ Window.ClientBounds.Height
+ ) * 0.5f,
+ iconSourceRect,
+ Color.White,
+ 0.0f,
+ new Vector2(
+ iconSourceRect.Width,
+ iconSourceRect.Height
+ ) * 0.5f,
+ 1.0f,
+ SpriteEffects.None,
+ 1.0f
+ );
+
+ //Draw only rectangle portion
+ SpriteBatch.Draw(
+ _logo,
+ new Vector2(
+ Window.ClientBounds.Width,
+ Window.ClientBounds.Height
+ ) * 0.5f,
+ wordmarkSourceRect,
+ Color.White,
+ 0.0f,
+ new Vector2(
+ wordmarkSourceRect.Width,
+ wordmarkSourceRect.Height
+ ) * 0.5f,
+ 1.0f,
+ SpriteEffects.None,
+ 0.0f
+ );
+
+ SpriteBatch.End();
base.Draw(gameTime);
}