AxiosEngine-old 

AxiosEngine-old Commit Details


Date:2012-06-24 14:56:00 (12 years 5 months ago)
Author:Natalie Adams
Branch:default
Commit:41eaa92cf131
Parents: 5a9d1b17f228
Message:+ Fixing UI detect bug

+ Adding Width/Height/Position/RealPosition to DrawableAxiosGameObject
Changes:
Maxios/Axios_settings.cs (1 diff)
Maxios/Engine/AxiosGameScreen.cs (1 diff)
Maxios/Engine/DrawableAxiosGameObject.cs (3 diffs)
Maxios/Engine/UI/AxiosUIObject.cs (1 diff)

File differences

axios/Axios_settings.cs
105105
106106
107107
108
109
108110
109111
110112
* be overwritten in each screen
* - Adding output to tcc console command to signal if it was disabled/enabled
* - Adding DegreeToRadian/RadianToDegree double extensions
* - Fixing UI detect bug
* - Adding Width/Height/Position/RealPosition to DrawableAxiosGameObject
*
*
*/
axios/Engine/AxiosGameScreen.cs
340340
341341
342342
343
343
344344
345345
346346
uiobjpos = uiobject.Position;
//objpos = this.Camera.ConvertScreenToWorld(uiobjpos);
uirect = new AxiosRectangle(uiobjpos.X, uiobjpos.Y, ConvertUnits.ToSimUnits(uiobject.Width), ConvertUnits.ToSimUnits(uiobject.Height));
uirect = new AxiosRectangle(ConvertUnits.ToSimUnits(uiobjpos.X), ConvertUnits.ToSimUnits(uiobjpos.Y), ConvertUnits.ToSimUnits(uiobject.Width), ConvertUnits.ToSimUnits(uiobject.Height));
if (uirect.Intersect(mousrect))
{
axios/Engine/DrawableAxiosGameObject.cs
1010
1111
1212
13
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
1435
1536
1637
......
3657
3758
3859
60
61
62
63
64
65
66
67
68
69
70
71
3972
4073
4174
......
5184
5285
5386
54
87
5588
56
89
5790
5891
5992
{
protected int _draworder;
protected Texture2D Texture;
public Vector2 Position = new Vector2(); //set this to a property and adjust if adjustunits is true
//public Vector2 Position = new Vector2(); //set this to a property and adjust if adjustunits is true
public Vector2 _position = Vector2.Zero;
public Vector2 Position
{
get
{
return ConvertUnits.ToDisplayUnits(_position);
}
set
{
_position = value;
}
}
public Vector2 RealPosition
{
get { return _position; }
private set { }
}
public Vector2 Origin = new Vector2();
protected bool _adjustunits = true;
set { _relativetocamera = value; }
}
public int Width
{
get { return this.Texture.Width; }
private set { }
}
public int Height
{
get { return this.Texture.Height; }
private set { }
}
public override void LoadContent(AxiosGameScreen gameScreen)
{
base.LoadContent(gameScreen);
else
gameScreen.ScreenManager.SpriteBatch.Begin();
if (_adjustunits)
gameScreen.ScreenManager.SpriteBatch.Draw(Texture, ConvertUnits.ToDisplayUnits(Position), null, Color.White, _rotation, Origin, _scale, SpriteEffects.None, 0);
gameScreen.ScreenManager.SpriteBatch.Draw(Texture, ConvertUnits.ToDisplayUnits(_position), null, Color.White, _rotation, Origin, _scale, SpriteEffects.None, 0);
else
gameScreen.ScreenManager.SpriteBatch.Draw(Texture, Position, null, Color.White, _rotation, Origin, _scale, SpriteEffects.None, 0);
gameScreen.ScreenManager.SpriteBatch.Draw(Texture, _position, null, Color.White, _rotation, Origin, _scale, SpriteEffects.None, 0);
gameScreen.ScreenManager.SpriteBatch.End();
}
axios/Engine/UI/AxiosUIObject.cs
44
55
66
7
8
9
10
11
127
13
14
15
16
17
188
199
2010
{
public class AxiosUIObject : DrawableAxiosGameObject
{
public int Width
{
get { return this.Texture.Width; }
private set { }
}
public int Height
{
get { return this.Texture.Height; }
private set {}
}
}
}

Archive Download the corresponding diff file

Page rendered in 0.42649s using 14 queries.