1
0
Fork 0

Mise en place de départ

This commit is contained in:
sheychen 2016-10-10 17:38:15 +02:00
parent fe6f195f1b
commit 9108f24cf9
7 changed files with 186 additions and 14 deletions

View File

@ -13,3 +13,45 @@
#---------------------------------- Content ---------------------------------#
#begin Fonts/basic.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:TextureFormat=Compressed
/build:Fonts/basic.spritefont
#begin Fonts/small.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:TextureFormat=Compressed
/build:Fonts/small.spritefont
#begin Fonts/title.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:TextureFormat=Compressed
/build:Fonts/title.spritefont
#begin Sounds/alert.mp3
/importer:Mp3Importer
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:Sounds/alert.mp3
#begin Sounds/bip.mp3
/importer:Mp3Importer
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:Sounds/bip.mp3
#begin Sounds/change.mp3
/importer:Mp3Importer
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:Sounds/change.mp3
#begin Sounds/valid.mp3
/importer:Mp3Importer
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:Sounds/valid.mp3

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

View File

@ -57,6 +57,9 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Icon.ico" />
<Content Include="Content\Textures\Hub\pointer0.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="OpenTK.dll.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

View File

@ -1,6 +1,11 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.IO;
using System.Reflection;
namespace Galactic_Colors_Control_GUI
{
@ -11,11 +16,39 @@ namespace Galactic_Colors_Control_GUI
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
ContentManager content;
private SoundEffect[] effects = new SoundEffect[4];
private SpriteFont smallFont;
private SpriteFont basicFont;
private SpriteFont titleFont;
private Texture2D nullSprite;
private Texture2D[] pointerSprites = new Texture2D[1];
Version version;
private MouseState oldState;
private MouseState newState;
private int mouseX;
private int mouseY;
private bool haveOverButton = false;
private string skinName;
private enum GameStatus { Home, Options, Game, Pause, End, Thanks }
private GameStatus gameStatus;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
graphics.IsFullScreen = false;
graphics.ApplyChanges();
Content.RootDirectory = "Content";
content = Content;
}
/// <summary>
@ -26,7 +59,9 @@ namespace Galactic_Colors_Control_GUI
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
version = Assembly.GetEntryAssembly().GetName().Version;
nullSprite = new Texture2D(GraphicsDevice, 1, 1);
nullSprite.SetData(new Color[1 * 1] { Color.White });
base.Initialize();
}
@ -40,6 +75,33 @@ namespace Galactic_Colors_Control_GUI
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
//effects[0] = content.Load<SoundEffect>("Sounds/alert");
//effects[1] = content.Load<SoundEffect>("Sounds/bip");
//effects[2] = content.Load<SoundEffect>("Sounds/change");
//effects[3] = content.Load<SoundEffect>("Sounds/valid");
smallFont = content.Load<SpriteFont>("Fonts/small");
basicFont = content.Load<SpriteFont>("Fonts/basic");
titleFont = content.Load<SpriteFont>("Fonts/title");
for (int i = 0; i < pointerSprites.Length; i++) {
Console.WriteLine("Load pointer" + i);
pointerSprites[i] = content.Load<Texture2D>("Textures/Hub/pointer" + i);
}
if (Directory.Exists("Skin/" + skinName))
{
if (File.Exists("Skin/" + skinName + "/Sounds/alert.mp3")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Sounds/alert.mp3", FileMode.Open)) { effects[0] = SoundEffect.FromStream(fileStream); }
if (File.Exists("Skin/" + skinName + "/Sounds/bip.mp3")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Sounds/bip.mp3", FileMode.Open)) { effects[1] = SoundEffect.FromStream(fileStream); }
if (File.Exists("Skin/" + skinName + "/Sounds/change.mp3")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Sounds/change.mp3", FileMode.Open)) { effects[2] = SoundEffect.FromStream(fileStream); }
if (File.Exists("Skin/" + skinName + "/Sounds/valid.mp3")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Sounds/valid.mp3", FileMode.Open)) { effects[3] = SoundEffect.FromStream(fileStream); }
for (int i = 0; i < pointerSprites.Length; i++)
{
if (File.Exists("Skin/" + skinName + "/Textures/Hub/pointer" + i + ".png")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Textures/Hub/pointer" + i + ".png", FileMode.Open)) { pointerSprites[i] = Texture2D.FromStream(GraphicsDevice, fileStream); }
}
}
// TODO: use this.Content to load your game content here
}
@ -62,8 +124,40 @@ namespace Galactic_Colors_Control_GUI
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
// TODO: Add your update logic here
mouseX = Mouse.GetState().X;
mouseY = Mouse.GetState().Y;
if (IsActive)
{
}
switch (gameStatus)
{
case GameStatus.Home:
break;
case GameStatus.Options:
break;
case GameStatus.Game:
break;
case GameStatus.Pause:
break;
case GameStatus.End:
break;
case GameStatus.Thanks:
break;
}
base.Update(gameTime);
}
@ -75,7 +169,38 @@ namespace Galactic_Colors_Control_GUI
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
spriteBatch.Begin();
switch (gameStatus)
{
case GameStatus.Home:
break;
case GameStatus.Options:
break;
case GameStatus.Game:
break;
case GameStatus.Pause:
break;
case GameStatus.End:
break;
case GameStatus.Thanks:
break;
}
spriteBatch.Draw(pointerSprites[0], new Rectangle(mouseX - 10, mouseY - 10, 20, 20), Color.Red);
spriteBatch.End();
base.Draw(gameTime);
}

View File

@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyProduct("Galactic Colors Control GUI")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("sheychen")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]

View File

@ -17,26 +17,28 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|Any CPU.Build.0 = Release|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|x86.ActiveCfg = Debug|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|x86.Build.0 = Debug|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Release|Any CPU.Build.0 = Release|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Release|x86.ActiveCfg = Release|Any CPU
{9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Release|x86.Build.0 = Release|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|Any CPU.Build.0 = Release|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|x86.ActiveCfg = Debug|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|x86.Build.0 = Debug|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Release|Any CPU.Build.0 = Release|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Release|x86.ActiveCfg = Release|Any CPU
{93582CE8-C8C8-4E19-908B-D671ECBADE25}.Release|x86.Build.0 = Release|Any CPU
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|Any CPU.ActiveCfg = Debug|x86
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|Any CPU.ActiveCfg = Release|x86
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|Any CPU.Build.0 = Release|x86
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|x86.ActiveCfg = Debug|x86
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|x86.Build.0 = Debug|x86
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Release|Any CPU.ActiveCfg = Release|x86
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Release|Any CPU.Build.0 = Release|x86
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Release|x86.ActiveCfg = Release|x86
{F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Release|x86.Build.0 = Release|x86
EndGlobalSection

View File

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Galactic Colors Control")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("sheychen")]
[assembly: AssemblyProduct("Galactic Colors Control")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]