reorganization, and skeleton of camera system.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
@@ -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;
|
||||
|
25
RhythmBullet/Zer01HD/Utilities/Camera/Camera2D.cs
Normal file
25
RhythmBullet/Zer01HD/Utilities/Camera/Camera2D.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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 }
|
||||
|
||||
|
Reference in New Issue
Block a user