27 lines
		
	
	
		
			923 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			923 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from lnx.logicnode.lnx_nodes import *
 | 
						|
 | 
						|
class SurfaceNode(LnxLogicTreeNode):
 | 
						|
    """Activates the output on the given touch event."""
 | 
						|
    bl_idname = 'LNMergedSurfaceNode'
 | 
						|
    bl_label = 'Touch'
 | 
						|
    lnx_section = 'surface'
 | 
						|
    lnx_version = 1
 | 
						|
 | 
						|
    property0: HaxeEnumProperty(
 | 
						|
        'property0',
 | 
						|
        items = [('started', 'Started', 'The screen surface starts to be touched'),
 | 
						|
                 ('down', 'Down', 'The screen surface is touched'),
 | 
						|
                 ('released', 'Released', 'The screen surface stops being touched'),
 | 
						|
                 ('moved', 'Moved', 'Moved')],
 | 
						|
        name='', default='down')
 | 
						|
 | 
						|
    def lnx_init(self, context):
 | 
						|
        self.add_output('LnxNodeSocketAction', 'Out')
 | 
						|
        self.add_output('LnxBoolSocket', 'State')
 | 
						|
 | 
						|
    def draw_buttons(self, context, layout):
 | 
						|
        layout.prop(self, 'property0')
 | 
						|
 | 
						|
    def draw_label(self) -> str:
 | 
						|
        return f'{self.bl_label}: {self.property0}'
 |