2012-05-08 03:20:22 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using FarseerPhysics.Dynamics;
|
|
|
|
using FarseerPhysics.Common;
|
|
|
|
using FarseerPhysics.SamplesFramework;
|
|
|
|
using FarseerPhysics.Factories;
|
|
|
|
using Microsoft.Xna.Framework.Content;
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
2012-05-12 22:54:30 +00:00
|
|
|
namespace Axios.Engine.Gleed2D
|
2012-05-08 03:20:22 +00:00
|
|
|
{
|
|
|
|
public partial class RectangleItem : Item
|
|
|
|
{
|
|
|
|
public float Width;
|
|
|
|
public float Height;
|
|
|
|
public Color FillColor;
|
|
|
|
|
|
|
|
Body _body;
|
|
|
|
|
|
|
|
public RectangleItem()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-05-19 02:15:51 +00:00
|
|
|
public override void load(AxiosGameScreen gameScreen, ref Dictionary<string, Texture2D> cache)
|
2012-05-08 03:20:22 +00:00
|
|
|
{
|
2012-05-19 02:15:51 +00:00
|
|
|
base.load(gameScreen, ref cache);
|
2012-05-08 03:20:22 +00:00
|
|
|
|
2012-05-19 02:15:51 +00:00
|
|
|
_body = BodyFactory.CreateRectangle(gameScreen.World, ConvertUnits.ToSimUnits(Width), ConvertUnits.ToSimUnits(Height), 1f);
|
2012-05-14 03:20:50 +00:00
|
|
|
_body.Position = ConvertUnits.ToSimUnits(Position) + new Vector2(ConvertUnits.ToSimUnits(Width)/2, ConvertUnits.ToSimUnits(Height)/2);
|
2012-05-08 03:20:22 +00:00
|
|
|
_body.UserData = this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|