Using the building footprint, the placement overlay is offset from the cursor so the cursor is in the approximate middle of the overlay (not precisely due to overlay snapping to tiles). The tile size (24) was used as a magic number in a lot of places, they have been replaced with Game.CellSize.
25 lines
451 B
C#
25 lines
451 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using OpenRa.Game.Graphics;
|
|
using IjwFramework.Types;
|
|
|
|
namespace OpenRa.Game.Traits
|
|
{
|
|
class Tree : IRender
|
|
{
|
|
Sprite Image;
|
|
|
|
public Tree(Sprite treeImage)
|
|
{
|
|
Image = treeImage;
|
|
}
|
|
|
|
public IEnumerable<Pair<Sprite, float2>> Render(Actor self)
|
|
{
|
|
yield return Pair.New(Image, Game.CellSize * (float2)self.Location);
|
|
}
|
|
}
|
|
}
|