forked from LeenkxTeam/Leenkx_Examples
update
This commit is contained in:
27
screentex/Sources/lnx/MyTrait.hx
Normal file
27
screentex/Sources/lnx/MyTrait.hx
Normal file
@ -0,0 +1,27 @@
|
||||
package lnx;
|
||||
|
||||
import leenkx.renderpath.RenderPathCreator;
|
||||
|
||||
class MyTrait extends iron.Trait {
|
||||
public function new() {
|
||||
super();
|
||||
|
||||
notifyOnRender2D(function(g:kha.graphics2.Graphics) {
|
||||
if (RenderPathCreator.finalTarget == null) return;
|
||||
|
||||
// Access final composited image that is afterwards drawn to the screen
|
||||
var image = RenderPathCreator.finalTarget.image;
|
||||
|
||||
g.color = 0xff000000;
|
||||
g.fillRect(0, 0, image.width / 5, image.height / 5);
|
||||
|
||||
g.color = 0xffffffff;
|
||||
if (kha.Image.renderTargetsInvertedY()) {
|
||||
g.drawScaledImage(image, 0, image.height / 5, image.width / 5, -image.height / 5);
|
||||
}
|
||||
else {
|
||||
g.drawScaledImage(image, 0, 0, image.width / 5, image.height / 5);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
BIN
screentex/screentex.blend
Normal file
BIN
screentex/screentex.blend
Normal file
Binary file not shown.
Reference in New Issue
Block a user