Files
LNXSDK/leenkx/Sources/leenkx/logicnode/WebviewCreateNode.hx
2026-07-13 15:44:52 -07:00

51 lines
1.1 KiB
Haxe

package leenkx.logicnode;
class WebviewCreateNode extends LogicNode {
public var property0: String;
public function new(tree: LogicTree) {
super(tree);
}
override function run(from: Int) {
var parentWindow: Int = (property0 == "embedded") ? 0 : -1;
var x: Int = inputs[1].get();
var y: Int = inputs[2].get();
var width: Int = inputs[3].get();
var height: Int = inputs[4].get();
var transparent: Bool = inputs[5].get();
var title: String = inputs[6].get();
var html: String = inputs[7].get();
var url: String = inputs[8].get();
var show: Bool = inputs[9].get();
#if kha_krom
var options: Dynamic = {
parentWindow: parentWindow,
x: x,
y: y,
width: width,
height: height,
transparent: transparent,
title: title
};
var id: Int = Krom.webviewCreate(options);
if (html != null && html != "") Krom.webviewLoadHTML(id, html);
if (url != null && url != "") Krom.webviewLoadURL(id, url);
if (show) Krom.webviewShow(id);
#else
var id: Int = -1;
#end
this.id = id;
runOutput(0);
}
var id: Int = -1;
override function get(from: Int): Dynamic {
return id;
}
}