
com.jtransc.game.canvas.Canvas Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtransc-media-game Show documentation
Show all versions of jtransc-media-game Show documentation
JVM AOT compiler currently generating Javascript and Haxe, with initial focus on Kotlin and games.
package com.jtransc.game.canvas;
import com.jtransc.media.JTranscRender;
import com.jtransc.game.batch.BatchBuilder;
public class Canvas {
BatchBuilder batches = new BatchBuilder();
public Context2D context2D = new Context2D(this);
public int width = 640;
public int height = 480;
public Texture image(String path, int width, int height) {
return new Texture(new BaseTexture(JTranscRender.createTexture(path, width, height), width, height));
}
public void start() {
batches.start();
}
public void draw() {
batches.render();
batches.reset();
context2D.reset();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy