Skip to content

Commit

Permalink
Merge pull request #3099 from t3du/DrawCameraUpd
Browse files Browse the repository at this point in the history
DrawCameraNode updates
  • Loading branch information
luboslenco authored Dec 9, 2024
2 parents 1fe956f + 16236d4 commit 05accc9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion armory/Sources/armory/logicnode/DrawCameraNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,22 @@ class DrawCameraNode extends LogicNode {
for(i in 0...cameras.length) {
final rt = renderTargets[i];

positions[i].set(
inputs[numStaticInputs + i * 5 + 1].get(),
inputs[numStaticInputs + i * 5 + 2].get()
);

final posX = positions[i].x;
final posY = positions[i].y;

g.color = 0xff000000;
g.fillRect(posX, posY, rt.width, rt.height);
g.color = 0xffffffff;
g.drawScaledImage(rt, posX, posY, rt.width, rt.height);

if (kha.Image.renderTargetsInvertedY())
g.drawScaledImage(rt, posX, posY+rt.height, rt.width, -rt.height);
else
g.drawScaledImage(rt, posX, posY, rt.width, rt.height);
}
}
}

0 comments on commit 05accc9

Please sign in to comment.