namespace refactor & progress on texture atlas

This commit is contained in:
Harrison Deng 2018-12-04 07:45:09 -06:00
parent 698dd9d2f0
commit b4ddd73f67
28 changed files with 95 additions and 52 deletions

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.Camera namespace RecrownedAthenaeum.Camera
{ {
public class Camera2D public class Camera2D
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.ContentSystem namespace RecrownedAthenaeum.ContentSystem
{ {
struct LoadableContent struct LoadableContent
{ {

View File

@ -9,7 +9,7 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.ContentSystem namespace RecrownedAthenaeum.ContentSystem
{ {
public class ContentManagerController public class ContentManagerController
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.ContentSystem namespace RecrownedAthenaeum.ContentSystem
{ {
public interface IContentPathModifier public interface IContentPathModifier
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.ContentSystem namespace RecrownedAthenaeum.ContentSystem
{ {
class NormalContentResolver : IContentPathModifier class NormalContentResolver : IContentPathModifier
{ {

View File

@ -6,15 +6,13 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.DataTypes namespace RecrownedAthenaeum.DataTypes
{ {
public class NinePatch public class NinePatch
{ {
public Color color; public Color color;
readonly Texture2D texture; readonly Texture2D texture;
readonly int a, b, c, d; readonly int a, b, c, d;
private Rectangle sourceRectangle;
private Rectangle drawnRectangle;
/// <summary> /// <summary>
/// A nine patch object. /// A nine patch object.
@ -39,6 +37,9 @@ namespace RhythmBullet.Utilities.DataTypes
public void Draw(SpriteBatch batch, Rectangle destination) public void Draw(SpriteBatch batch, Rectangle destination)
{ {
Rectangle sourceRectangle;
Rectangle drawnRectangle;
//1x1 //1x1
drawnRectangle.X = destination.X; drawnRectangle.X = destination.X;
drawnRectangle.Y = destination.Y; drawnRectangle.Y = destination.Y;

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.DataTypes namespace RecrownedAthenaeum.DataTypes
{ {
public class Resolution : IComparable<Resolution> public class Resolution : IComparable<Resolution>
{ {

View File

@ -0,0 +1,22 @@
using Recrowned_Athenaeum.DataTypes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;23
namespace RecrownedAthenaeum.DataTypes
{
public class TextureAtlas
{
private TextureAtlasRegion[] textureRegions;
public TextureAtlas(TextureAtlasRegion[] textureRegions)
{
this.textureRegions = textureRegions;
}
}
}

View File

@ -0,0 +1,19 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Recrowned_Athenaeum.DataTypes
{
public struct TextureAtlasRegion
{
string name;
Rectangle bounds;
Vector2 origin;
bool ninePatch;
int a, b, c, d;
}
}

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.Input namespace RecrownedAthenaeum.Input
{ {
public interface IInputListener public interface IInputListener
{ {

View File

@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
namespace RhythmBullet.Utilities.Input namespace RecrownedAthenaeum.Input
{ {
class InputListener : IInputListener class InputListener : IInputListener
{ {

View File

@ -1,13 +1,13 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using RhythmBullet.Utilities.Input; using RecrownedAthenaeum.Input;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.Input namespace RecrownedAthenaeum.Input
{ {
public static class InputUtilities public static class InputUtilities
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.ParticleSystem namespace RecrownedAthenaeum.ParticleSystem
{ {
class Particle class Particle
{ {

View File

@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace RhythmBullet.Utilities.Persistence namespace RecrownedAthenaeum.Persistence
{ {
public class Preferences public class Preferences
{ {

View File

@ -1,11 +1,10 @@
using RhythmBullet.Preferences; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace RhythmBullet.Utilities.Persistence namespace RecrownedAthenaeum.Persistence
{ {
public class PreferencesManager public class PreferencesManager
{ {

View File

@ -49,6 +49,8 @@
<Compile Include="ContentSystem\NormalContentResolver.cs" /> <Compile Include="ContentSystem\NormalContentResolver.cs" />
<Compile Include="DataTypes\NinePatch.cs" /> <Compile Include="DataTypes\NinePatch.cs" />
<Compile Include="DataTypes\Resolution.cs" /> <Compile Include="DataTypes\Resolution.cs" />
<Compile Include="DataTypes\TextureAtlas.cs" />
<Compile Include="DataTypes\TextureAtlasRegion.cs" />
<Compile Include="Input\IInputListener.cs" /> <Compile Include="Input\IInputListener.cs" />
<Compile Include="Input\InputListener.cs" /> <Compile Include="Input\InputListener.cs" />
<Compile Include="Input\InputUtilities.cs" /> <Compile Include="Input\InputUtilities.cs" />

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.ScreenSystem namespace RecrownedAthenaeum.ScreenSystem
{ {
public interface ITransition public interface ITransition
{ {

View File

@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
namespace RhythmBullet.Utilities.ScreenSystem namespace RecrownedAthenaeum.ScreenSystem
{ {
public class LoadingScreen : Screen, ITransition public class LoadingScreen : Screen, ITransition
{ {

View File

@ -1,13 +1,13 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Utilities.Camera; using RecrownedAthenaeum.Camera;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.ScreenSystem namespace RecrownedAthenaeum.ScreenSystem
{ {
public enum ScreenState { EnterTransition, ExitTransition, Normal } public enum ScreenState { EnterTransition, ExitTransition, Normal }

View File

@ -1,6 +1,6 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Utilities.Camera; using RecrownedAthenaeum.Camera;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
@ -8,7 +8,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.ScreenSystem namespace RecrownedAthenaeum.ScreenSystem
{ {
public delegate void FirstScreenChange(Screen screen); public delegate void FirstScreenChange(Screen screen);

View File

@ -1,15 +1,15 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Utilities.Camera; using RecrownedAthenaeum.Camera;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.UI.Book namespace RecrownedAthenaeum.UI.Book
{ {
class Book public class Book
{ {
Camera2D camera; Camera2D camera;
Page targetPage; Page targetPage;

View File

@ -1,16 +1,16 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.UI.Modular; using RecrownedAthenaeum.UI.Modular;
using RhythmBullet.Utilities.Camera; using RecrownedAthenaeum.Camera;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.UI.Book namespace RecrownedAthenaeum.UI.Book
{ {
class Page : UIModuleGroup public class Page : UIModuleGroup
{ {
private readonly int pageX, pageY; private readonly int pageX, pageY;
public bool NeedsSizeUpdate; public bool NeedsSizeUpdate;

View File

@ -1,15 +1,15 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.UI.Modular; using RecrownedAthenaeum.UI.Modular;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.UI.Modular.Modules namespace RecrownedAthenaeum.UI.Modular.Modules
{ {
class Image : UIModule public class Image : UIModule
{ {
public float rotation = 0f; public float rotation = 0f;
public Texture2D Texture { get; set; } public Texture2D Texture { get; set; }

View File

@ -1,15 +1,15 @@
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using RhythmBullet.UI.Modular; using RecrownedAthenaeum.UI.Modular;
using RhythmBullet.Utilities.DataTypes; using RecrownedAthenaeum.DataTypes;
using RhythmBullet.Utilities.Input; using RecrownedAthenaeum.Input;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.UI.Modular.Modules.Interactive namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
{ {
public delegate bool Clicked(); public delegate bool Clicked();

View File

@ -1,21 +1,21 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.UI.Modular.Modules; using RecrownedAthenaeum.UI.Modular.Modules;
using RhythmBullet.Utilities.DataTypes; using RecrownedAthenaeum.DataTypes;
using RhythmBullet.Utilities.UI.Modular.Modules.Interactive; using RecrownedAthenaeum.UI.Modular.Modules.Interactive;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.Utilities.UI.Modular.Modules.Interactive namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive
{ {
internal class TextButton : Button public class TextButton : Button
{ {
private TextLabel label; private TextLabel label;
internal TextButton(string text, SpriteFont font, NinePatch background) : base(background) public TextButton(string text, SpriteFont font, NinePatch background) : base(background)
{ {
label = new TextLabel(font, text); label = new TextLabel(font, text);
label.autoScale = true; label.autoScale = true;

View File

@ -1,13 +1,13 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Utilities.Camera; using RecrownedAthenaeum.Camera;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.UI.Modular.Modules namespace RecrownedAthenaeum.UI.Modular.Modules
{ {
public class TextLabel : UIModule public class TextLabel : UIModule
{ {

View File

@ -1,15 +1,15 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using RhythmBullet.Utilities.Camera; using RecrownedAthenaeum.Camera;
using RhythmBullet.Utilities.Input; using RecrownedAthenaeum.Input;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace RhythmBullet.UI.Modular namespace RecrownedAthenaeum.UI.Modular
{ {
public class UIModule : IInputListener public class UIModule : IInputListener
{ {

View File

@ -6,10 +6,10 @@ using System.Threading.Tasks;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using RhythmBullet.Utilities.Camera; using RecrownedAthenaeum.Camera;
using RhythmBullet.Utilities.Input; using RecrownedAthenaeum.Input;
namespace RhythmBullet.UI.Modular namespace RecrownedAthenaeum.UI.Modular
{ {
public class UIModuleGroup : UIModule public class UIModuleGroup : UIModule
{ {