Create working GUI scaffolding
This commit is contained in:
@@ -2,6 +2,7 @@ package com.bartlomiejpluta.base.api.game.context;
|
||||
|
||||
import com.bartlomiejpluta.base.api.game.camera.Camera;
|
||||
import com.bartlomiejpluta.base.api.game.entity.Entity;
|
||||
import com.bartlomiejpluta.base.api.game.gui.GUI;
|
||||
import com.bartlomiejpluta.base.api.game.image.Image;
|
||||
import com.bartlomiejpluta.base.api.game.screen.Screen;
|
||||
|
||||
@@ -15,4 +16,6 @@ public interface Context {
|
||||
Entity createEntity(String entitySetUid);
|
||||
|
||||
Image getImage(String imageUid);
|
||||
|
||||
GUI newGUI();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.bartlomiejpluta.base.api.game.gui;
|
||||
|
||||
public interface Color {
|
||||
float getRed();
|
||||
|
||||
float getGreen();
|
||||
|
||||
float getBlue();
|
||||
|
||||
float getAlpha();
|
||||
|
||||
void setRed(float value);
|
||||
|
||||
void setGreen(float value);
|
||||
|
||||
void setBlue(float value);
|
||||
|
||||
void setAlpha(float value);
|
||||
|
||||
void setColor(float red, float green, float blue);
|
||||
|
||||
void setColor(float red, float green, float blue, float alpha);
|
||||
}
|
||||
@@ -1,7 +1,16 @@
|
||||
package com.bartlomiejpluta.base.api.game.gui;
|
||||
|
||||
import com.bartlomiejpluta.base.api.internal.logic.Updatable;
|
||||
import com.bartlomiejpluta.base.api.internal.gc.Disposable;
|
||||
import com.bartlomiejpluta.base.api.internal.render.Renderable;
|
||||
|
||||
public interface GUI extends Updatable, Renderable {
|
||||
public interface GUI extends Renderable, Disposable {
|
||||
Widget getRoot();
|
||||
|
||||
void setRoot(Widget root);
|
||||
|
||||
void drawRectangle(float x, float y, float w, float h);
|
||||
|
||||
void fillColor(Color color);
|
||||
|
||||
Color createColor(float red, float green, float blue, float alpha);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.bartlomiejpluta.base.api.game.gui;
|
||||
|
||||
import com.bartlomiejpluta.base.api.game.screen.Screen;
|
||||
|
||||
public interface Widget {
|
||||
Widget getParent();
|
||||
|
||||
void draw(Screen screen, GUI gui);
|
||||
}
|
||||
@@ -23,4 +23,6 @@ public interface Screen {
|
||||
void update();
|
||||
|
||||
void clear(float r, float g, float b, float alpha);
|
||||
|
||||
void restoreState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user