git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1339 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
(no author)
2007-07-24 07:59:41 +00:00
parent 7e40835c5e
commit 5bf38488d2
10 changed files with 113 additions and 64 deletions

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenRa.TechTree;
namespace OpenRa.Game
{
class SidebarItem
{
public readonly Item techTreeItem;
public readonly float2 location;
readonly Sprite sprite;
public SidebarItem(Sprite s, Item item, int y)
{
this.techTreeItem = item;
this.sprite = s;
location = new float2(item.IsStructure ? 0 : 64, y);
}
public bool Clicked(float2 p)
{
if (p.X < location.X || p.Y < location.Y)
return false;
if (p.X > location.X + 64 || p.Y > location.Y + 48)
return false;
return true;
}
public void Paint(SpriteRenderer renderer, float2 offset)
{
renderer.DrawSprite(sprite, location + offset, 0);
}
}
}