armory/blender/arm/logicnode/input/LN_touch.py

27 lines
942 B
Python
Raw Normal View History

2017-03-21 03:06:38 +01:00
from arm.logicnode.arm_nodes import *
class SurfaceNode(ArmLogicTreeNode):
2020-11-17 16:01:15 +01:00
"""Activates the output on the given touch event."""
bl_idname = 'LNMergedSurfaceNode'
2020-11-17 16:01:15 +01:00
bl_label = 'Touch'
2020-10-27 19:44:37 +01:00
arm_section = 'surface'
arm_version = 1
2020-10-27 19:44:37 +01:00
2018-12-18 23:48:38 +01:00
property0: EnumProperty(
2020-11-17 21:35:22 +01:00
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')
2017-03-21 03:06:38 +01:00
def init(self, context):
super(SurfaceNode, self).init(context)
2020-09-08 21:49:02 +02:00
self.add_output('ArmNodeSocketAction', 'Out')
self.add_output('NodeSocketBool', 'State')
2017-04-03 22:29:46 +02:00
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
2020-12-15 23:47:38 +01:00
def draw_label(self) -> str:
return f'{self.bl_label}: {self.property0}'