Files
OpenRA/OpenRa.Game/Region.cs

29 lines
609 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace OpenRa.Game
{
class Region
{
Point location;
Size size;
Renderable drawFunction;
public Region(Point location, Size size, Renderable drawFunction)
{
this.location = location;
this.size = size;
this.drawFunction = drawFunction;
}
public void Draw(Renderer renderer, Viewport viewport)
{
renderer.Device.EnableScissor(location.X, location.Y, size.Width, size.Height);
drawFunction(renderer, viewport);
renderer.Device.DisableScissor();
}
}
}