reorganization, and skeleton of camera system.

This commit is contained in:
Harrison Deng 2018-11-11 14:44:30 -06:00
parent f3a3d31ad8
commit 3c44a52a8f
9 changed files with 32 additions and 8 deletions

View File

@ -48,6 +48,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Zer01HD\Game\Screens\Transitions\FadeAwayTransition.cs" />
<Compile Include="Zer01HD\Utilities\Camera\Camera2D.cs" />
<Compile Include="Zer01HD\Utilities\ContentSystem\NormalContentResolver.cs" />
<Compile Include="Zer01HD\Utilities\Input\IInputListener.cs" />
<Compile Include="Zer01HD\Utilities\Input\InputListener.cs" />

View File

@ -8,7 +8,7 @@ using RhythmBullet.Zer01HD.Utilities;
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
using RhythmBullet.Zer01HD.Utilities.DataTypes;
using RhythmBullet.Zer01HD.Utilities.Input;
using RhythmBullet.Zer01HD.Utilities.UI.ScreenSystem;
using RhythmBullet.Zer01HD.Utilities.ScreenSystem;
using System;
using System.Diagnostics;

View File

@ -4,7 +4,7 @@ using RhythmBullet.Zer01HD.Game.Screens.Transitions;
using RhythmBullet.Zer01HD.UI;
using RhythmBullet.Zer01HD.Utilities.ContentSystem;
using RhythmBullet.Zer01HD.Utilities.UI;
using RhythmBullet.Zer01HD.Utilities.UI.ScreenSystem;
using RhythmBullet.Zer01HD.Utilities.ScreenSystem;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@ -18,7 +18,6 @@ namespace RhythmBullet.Zer01HD.Game.Screens
{
FadeAwayTransition fat;
Texture2D background;
Viewport viewport;
public MainScreen(ContentSystem assets) : base(true)
{

View File

@ -1,7 +1,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Zer01HD.Utilities.UI;
using RhythmBullet.Zer01HD.Utilities.UI.ScreenSystem;
using RhythmBullet.Zer01HD.Utilities.ScreenSystem;
using System;
using System.Collections.Generic;
using System.Diagnostics;

View File

@ -0,0 +1,25 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.Utilities.Camera
{
class Camera2D
{
public float Zoom;
public Vector2 Position;
public Matrix Transform { get; private set; }
public void Update(Viewport viewport)
{
Transform =
Matrix.CreateTranslation(new Vector3(Position.X, Position.Y, 0)) *
Matrix.CreateScale(Zoom) *
Matrix.CreateTranslation(new Vector3(viewport.Width/2f, viewport.Height/2f, 0f));
}
}
}

View File

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

View File

@ -3,7 +3,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
namespace RhythmBullet.Zer01HD.Utilities.UI.ScreenSystem
namespace RhythmBullet.Zer01HD.Utilities.ScreenSystem
{
class LoadingScreen : Screen, ITransition
{

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.Utilities.UI.ScreenSystem
namespace RhythmBullet.Zer01HD.Utilities.ScreenSystem
{
public enum ScreenState { EnterTransition, ExitTransition, Normal }

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BulletSharp" version="0.11.1" targetFramework="net45" />
<package id="Comora" version="0.5.0" targetFramework="net45" />
<package id="DSP" version="1.0.0" targetFramework="net45" />
</packages>