mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 03:59:26 +02:00
update mindow
This commit is contained in:
@@ -229,10 +229,10 @@ public class UnitWindow extends Window {
|
||||
Draw.color(Color.white);
|
||||
Draw.alpha(parentAlpha * color.a);
|
||||
BarInfo.BarData data = BarInfo.data.get(index);
|
||||
getDrawable().draw(x, y, width, height);
|
||||
data.icon.draw(x, y, width, height);
|
||||
if (!hasMouse() && ScissorStack.push(Tmp.r1.set(ScissorStack.peek().x + x, ScissorStack.peek().y + y, width, height * data.number))) {
|
||||
Draw.color(data.color);
|
||||
getDrawable().draw(x, y, width, height);
|
||||
data.icon.draw(x, y, width, height);
|
||||
ScissorStack.pop();
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ public class UnitWindow extends Window {
|
||||
|
||||
@Override
|
||||
public void exit(InputEvent event, float x, float y, int pointer, Element fromActor){
|
||||
icon.setDrawable(BarInfo.data.get(index).icon);
|
||||
icon.setDrawable(BarInfo.data.size >= index ? Icon.none : BarInfo.data.get(index).icon);
|
||||
}
|
||||
});
|
||||
icon.clicked(()->{
|
||||
|
||||
@@ -44,6 +44,14 @@ public class Window extends Table {
|
||||
id = WindowManager.register(this);
|
||||
|
||||
visible(() -> shown);
|
||||
|
||||
update(() -> {
|
||||
if(x > Core.graphics.getWidth() - getWidth()/2) setPosition(Core.graphics.getWidth() - getWidth()/2, y);
|
||||
else if(x < -getWidth()/2) setPosition(-getWidth()/2, y);
|
||||
|
||||
if(y > Core.graphics.getHeight() - getHeight()/2) setPosition(x, Core.graphics.getHeight() - getHeight()/2);
|
||||
else if(y < -getHeight()/2) setPosition(x, -getHeight()/2);
|
||||
});
|
||||
}
|
||||
|
||||
protected void build(Table t){
|
||||
|
||||
Reference in New Issue
Block a user