forked from Onek8/LNXSDK
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
from lnx.logicnode.lnx_nodes import *
|
|
|
|
|
|
class WebviewCreateNode(LnxLogicTreeNode):
|
|
"""Creates a WebView window and returns its ID"""
|
|
bl_idname = 'LNWebviewCreateNode'
|
|
bl_label = 'Webview Create'
|
|
lnx_category = 'Krom Runtime'
|
|
lnx_section = 'webview'
|
|
lnx_version = 1
|
|
|
|
property0: HaxeEnumProperty(
|
|
'property0',
|
|
items=[('embedded', 'Embedded', 'Embed webview in the engine window'),
|
|
('external', 'External', 'Detached OS window')],
|
|
name='Window Mode', default='external')
|
|
|
|
def lnx_init(self, context):
|
|
self.add_input('LnxNodeSocketAction', 'In')
|
|
self.add_input('LnxIntSocket', 'X', default_value=0)
|
|
self.add_input('LnxIntSocket', 'Y', default_value=0)
|
|
self.add_input('LnxIntSocket', 'Width', default_value=800)
|
|
self.add_input('LnxIntSocket', 'Height', default_value=600)
|
|
self.add_input('LnxBoolSocket', 'Transparent', default_value=True)
|
|
self.add_input('LnxStringSocket', 'Title', default_value='WebView')
|
|
self.add_input('LnxStringSocket', 'HTML')
|
|
self.add_input('LnxStringSocket', 'URL')
|
|
self.add_input('LnxBoolSocket', 'Show', default_value=True)
|
|
|
|
self.add_output('LnxNodeSocketAction', 'Out')
|
|
self.add_output('LnxIntSocket', 'ID')
|
|
|
|
def draw_buttons(self, context, layout):
|
|
layout.prop(self, 'property0')
|