Added mouse over

This commit is contained in:
Ziver Koc 2007-04-18 16:06:44 +00:00
parent 22965dbdd1
commit c6ba0ea532
6 changed files with 129 additions and 87 deletions

View file

@ -9,6 +9,7 @@ import ei.engine.texture.Texture;
public class SelectBox {
private Node selectNode;
private Node mouseOverNode;
private Sprite value;
private int max;
private float width;
@ -25,6 +26,7 @@ public class SelectBox {
this.max = max;
this.width = x;
selectNode = new Node("SelectionNode");
mouseOverNode = new Node("MouseOverNode");
Texture tex = new Texture();
tex.setColor(new Vector4f(0.5f, 1.0f, 0.5f,1));
@ -36,11 +38,13 @@ public class SelectBox {
value.setSize(new Vector2f(x,height));
value.setLocation(new Vector2f(0,-x/2+height/2));
selectNode.add(value);
mouseOverNode.add(value);
Box bar = new Box("bar",tex);
bar.setSize(new Vector2f(x,height));
bar.setLocation(new Vector2f(0,-x/2+height/2));
selectNode.add(bar);
mouseOverNode.add(bar);
Box select = new Box("select",tex);
select.setSize(new Vector2f(x,y));
@ -54,10 +58,20 @@ public class SelectBox {
*
* @return The node of the selection
*/
public Node getNode(){
public Node getSelectNode(){
return selectNode;
}
/**
* Returns the node of the selection
*
* @return The node of the selection
*/
public Node getMouseOverNode(){
return mouseOverNode;
}
/**
* Sets the value of the health bar
*