korge
korge copied to clipboard
renderToBitmap on stage does not save the background

To replicate:
Korge(width = 512, height = 512, bgcolor = Colors.RED) {
val views = injector.get<Views>()
val image = solidRect(100, 100, Colors.YELLOW) {
rotation = maxDegrees
anchor(.5, .5)
scale(.8)
position(256, 256)
}
val ss1 = renderToBitmap(views)
resourcesVfs["ss1.png"].writeBitmap(ss1, PNG)
}
Expectation:
The Stage
is actually empty. The background clearing happens elsewhere. We could emulate it somehow as an exception. But I guess there might be cases where people might want that image with transparency, right?
Should we add an optional parameter for rendering the background?
Yeah that would be great.