Skip to content

Instantly share code, notes, and snippets.

@smallfx
Created November 3, 2020 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smallfx/f45c1ae2ba47748f78841c9a4920f084 to your computer and use it in GitHub Desktop.
Save smallfx/f45c1ae2ba47748f78841c9a4920f084 to your computer and use it in GitHub Desktop.
Krom bug example?
package;
import kha.Assets;
import kha.Color;
import kha.Framebuffer;
import kha.Scheduler;
import kha.System;
class Main {
static function update(): Void {
}
static function render(frames: Array<Framebuffer>): Void {
final fb = frames[0];
final g2 = fb.g2;
g2.begin(true);
g2.drawSubImage(Assets.images.image_one,
1,
1,
0,
0,
32,
32);
g2.drawSubImage(Assets.images.image_two,
20,
20,
0,
0,
32,
32);
g2.end();
}
public static function main() {
System.start({title: "Project", width: 1024, height: 768}, function (_) {
Assets.loadEverything(function () {
Scheduler.addTimeTask(function () { update(); }, 0, 1 / 60);
System.notifyOnFrames(function (frames) { render(frames); });
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment