All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.game.canvas.Canvas Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating Javascript and Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.5.0
Show newest version
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