Adding initial files
This commit is contained in:
97
axios/Engine/UI/AxiosButton.cs
Normal file
97
axios/Engine/UI/AxiosButton.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using FarseerPhysics.SamplesFramework;
|
||||
using FarseerPhysics.Factories;
|
||||
using FarseerPhysics.Dynamics;
|
||||
|
||||
namespace Axios.Engine.UI
|
||||
{
|
||||
public class AxiosButton : AxiosUIObject
|
||||
{
|
||||
protected Texture2D _hovertexture;
|
||||
protected Texture2D _clicktexture;
|
||||
protected Texture2D _normaltexture;
|
||||
|
||||
/// <summary>
|
||||
/// HoverTexture is the texture that will be set when the mouse hovers over the button
|
||||
/// </summary>
|
||||
public Texture2D HoverTexture
|
||||
{
|
||||
get { return this._hovertexture; }
|
||||
set { this._hovertexture = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The ClickTexture is the texture that will be set when the user clicks on the button
|
||||
/// </summary>
|
||||
public Texture2D ClickTexture
|
||||
{
|
||||
get { return this._clicktexture; }
|
||||
set { this._clicktexture = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The normal texture is the texture when the button is not active
|
||||
/// </summary>
|
||||
public Texture2D NormalTexture
|
||||
{
|
||||
get { return this._normaltexture; }
|
||||
set { this._normaltexture = value; this.Texture = value; }
|
||||
}
|
||||
|
||||
public AxiosButton()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void LoadContent(AxiosGameScreen gameScreen)
|
||||
{
|
||||
base.LoadContent(gameScreen);
|
||||
|
||||
}
|
||||
|
||||
public override void OnMouseHover(AxiosGameScreen gameScreen, InputHelper input)
|
||||
{
|
||||
base.OnMouseHover(gameScreen, input);
|
||||
|
||||
this.Texture = _hovertexture;
|
||||
|
||||
}
|
||||
|
||||
public override void OnMouseLeave(AxiosGameScreen gameScreen, InputHelper input)
|
||||
{
|
||||
base.OnMouseLeave(gameScreen, input);
|
||||
|
||||
this.Texture = _normaltexture;
|
||||
}
|
||||
|
||||
public override void OnMouseDown(AxiosGameScreen gameScreen, InputHelper input)
|
||||
{
|
||||
base.OnMouseDown(gameScreen, input);
|
||||
|
||||
this.Texture = _clicktexture;
|
||||
}
|
||||
|
||||
public override void OnMouseUp(AxiosGameScreen gameScreen, InputHelper input)
|
||||
{
|
||||
base.OnMouseUp(gameScreen, input);
|
||||
|
||||
this.Texture = _hovertexture;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void HandleCursor(AxiosGameScreen gameScreen, InputHelper input)
|
||||
{
|
||||
base.HandleCursor(gameScreen, input);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
25
axios/Engine/UI/AxiosUIObject.cs
Normal file
25
axios/Engine/UI/AxiosUIObject.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Axios.Engine;
|
||||
|
||||
namespace Axios.Engine.UI
|
||||
{
|
||||
public class AxiosUIObject : DrawableAxiosGameObject
|
||||
{
|
||||
public int Width
|
||||
{
|
||||
get { return this.Texture.Width; }
|
||||
private set { }
|
||||
}
|
||||
|
||||
public int Height
|
||||
{
|
||||
get { return this.Texture.Height; }
|
||||
private set {}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user