Created
November 3, 2020 22:12
-
-
Save smallfx/f45c1ae2ba47748f78841c9a4920f084 to your computer and use it in GitHub Desktop.
Krom bug example?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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