forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
38
leenkx/Sources/leenkx/logicnode/DrawCircleNode.hx
Normal file
38
leenkx/Sources/leenkx/logicnode/DrawCircleNode.hx
Normal file
@ -0,0 +1,38 @@
|
||||
package leenkx.logicnode;
|
||||
|
||||
import kha.Color;
|
||||
import leenkx.renderpath.RenderToTexture;
|
||||
|
||||
#if lnx_ui
|
||||
using zui.GraphicsExtension;
|
||||
#end
|
||||
|
||||
class DrawCircleNode extends LogicNode {
|
||||
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function run(from: Int) {
|
||||
#if lnx_ui
|
||||
RenderToTexture.ensure2DContext("DrawCircleNode");
|
||||
|
||||
final colorVec = inputs[1].get();
|
||||
RenderToTexture.g.color = Color.fromFloats(colorVec.x, colorVec.y, colorVec.z, colorVec.w);
|
||||
|
||||
final segments = inputs[4].get();
|
||||
final cx = inputs[5].get();
|
||||
final cy = inputs[6].get();
|
||||
final radius = inputs[7].get();
|
||||
|
||||
if (inputs[2].get()) {
|
||||
RenderToTexture.g.fillCircle(cx, cy, radius, segments);
|
||||
}
|
||||
else {
|
||||
RenderToTexture.g.drawCircle(cx, cy, radius, inputs[3].get(), segments);
|
||||
}
|
||||
#end
|
||||
|
||||
runOutput(0);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user