git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1236 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -7,7 +7,7 @@ using BluntDirectX.Direct3D;
|
||||
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
public delegate void Renderable(Renderer renderer, Viewport viewport);
|
||||
delegate void Renderable(Renderer renderer, Viewport viewport);
|
||||
class Viewport
|
||||
{
|
||||
readonly Size clientSize;
|
||||
@@ -18,6 +18,9 @@ namespace OpenRa.Game
|
||||
public PointF ScrollPosition { get { return scrollPosition.ToPointF(); } }
|
||||
public Size ClientSize { get { return clientSize; } }
|
||||
|
||||
public float2 Location { get { return scrollPosition; } }
|
||||
public float2 Size { get { return scrollPosition + new float2(ClientSize); } }
|
||||
|
||||
public void Scroll(float2 delta)
|
||||
{
|
||||
scrollPosition = (scrollPosition + delta).Constrain(new Range<float2>(float2.Zero, mapSize));
|
||||
|
||||
Reference in New Issue
Block a user