BaseGame draws a default screen

This commit is contained in:
DaniTheSkunk 2022-10-10 23:16:09 +00:00
parent 09362620e5
commit 2809079025
3 changed files with 6 additions and 1 deletions

View File

@ -1,14 +1,19 @@
package com.danitheskunk.skunkworks; package com.danitheskunk.skunkworks;
import com.danitheskunk.skunkworks.gfx.Color;
import com.danitheskunk.skunkworks.gfx.IRenderContext; import com.danitheskunk.skunkworks.gfx.IRenderContext;
import com.danitheskunk.skunkworks.gfx.font.IFont;
public abstract class BaseGame { public abstract class BaseGame {
protected Engine engine; protected Engine engine;
protected IWindow window; protected IWindow window;
protected IFont debugFont;
public BaseGame(Vec2i windowSize, String windowTitle) { public BaseGame(Vec2i windowSize, String windowTitle) {
this.engine = new Engine(); this.engine = new Engine();
this.window = engine.openWindow(windowSize, windowTitle); this.window = engine.openWindow(windowSize, windowTitle);
//todo: load from .jar
this.debugFont = window.loadFontTileset("fonts/ega-8x14.png");
init(); init();
} }
@ -28,7 +33,7 @@ public abstract class BaseGame {
} }
protected void render(IRenderContext rc) { protected void render(IRenderContext rc) {
//todo: demo text? rc.drawString(new Vec2i(8, 8), "Welcome to Skunkworks, please overide the render method to get started", debugFont, Color.LIGHT_GRAY);
} }
protected void update(double delta) { protected void update(double delta) {

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 B

After

Width:  |  Height:  |  Size: 1.0 KiB