Create ScreenWidget - a screen aware parent of root widget

This commit is contained in:
2021-03-11 19:10:13 +01:00
parent b80632c705
commit 0a9bd87c29
4 changed files with 253 additions and 10 deletions

View File

@@ -5,6 +5,8 @@ import com.bartlomiejpluta.base.api.game.screen.Screen;
public interface Widget {
Widget getParent();
void setParent(Widget parent);
float getX();
float getY();

View File

@@ -98,6 +98,7 @@ public abstract class Component implements Widget {
return parent;
}
@Override
public void setParent(Widget parent) {
this.parent = parent;
}