-
-
Notifications
You must be signed in to change notification settings - Fork 103
I cant seem to render text. #788
-
package pkg2d.platformer.game;
import de.gurkenlabs.litiengine.Game;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
/**
*
-
@author KTECH
*/
public class Main {/**
- @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
- @param args the command line arguments
Game.init(args);
Graphics2D g = null;
Game.graphics().renderText(g, "my text", 50, 100);
Game.loop();
}
}
Please assist
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 5 replies
-
You are passing null as the Graphics2D object to draw on.
The proper way would be to create and add a Screen, then in that screen's render method take the Graphics2D instance to draw whatever you want.
Beta Was this translation helpful? Give feedback.
All reactions
-
😄 1
-
Any small amount of code
Beta Was this translation helpful? Give feedback.
All reactions
-
how can i do that? The documentation is a bit vague
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you for your reply it worked!!
Beta Was this translation helpful? Give feedback.
All reactions
-
Awesome! 👍
Beta Was this translation helpful? Give feedback.