Fixed screen rendering
This commit is contained in:
@@ -7,6 +7,10 @@ import java.util.List;
|
|||||||
public abstract class SaturnScreen {
|
public abstract class SaturnScreen {
|
||||||
public static interface ScreenProvider {
|
public static interface ScreenProvider {
|
||||||
public void close();
|
public void close();
|
||||||
|
|
||||||
|
public int getWidth();
|
||||||
|
|
||||||
|
public int getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
// General
|
// General
|
||||||
@@ -29,8 +33,8 @@ public abstract class SaturnScreen {
|
|||||||
|
|
||||||
protected void init() {
|
protected void init() {
|
||||||
elements.clear();
|
elements.clear();
|
||||||
width *= 2;
|
width = provider.getWidth();
|
||||||
height *= 2;
|
height = provider.getHeight();
|
||||||
ui(); // abstraction to render the saturn ui and also render extra stuff here
|
ui(); // abstraction to render the saturn ui and also render extra stuff here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ public class SaturnScreenFabric extends Screen implements ScreenProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
|
width *= 2;
|
||||||
|
height *= 2;
|
||||||
screen.init();
|
screen.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,4 +133,14 @@ public class SaturnScreenFabric extends Screen implements ScreenProvider {
|
|||||||
this.screen.onClose();
|
this.screen.onClose();
|
||||||
super.close();
|
super.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getWidth() {
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getHeight() {
|
||||||
|
return height;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user