actually checking if is lodaded in base game, not sprite component, in order to match the documentation

This commit is contained in:
Luan Nico
2019-01-01 22:47:35 -02:00
parent 63dcc25c69
commit 307e375378

View File

@ -217,6 +217,9 @@ abstract class BaseGame extends Game {
/// It translates the camera unless hud, call the render method and restore the canvas.
/// This makes sure the canvas is not messed up by one component and all components render independently.
void renderComponent(Canvas canvas, Component c) {
if (!c.loaded()) {
return;
}
if (!c.isHud()) {
canvas.translate(-camera.x, -camera.y);
}