mirror of
https://github.com/Relintai/gdnative_python.git
synced 2025-01-08 15:29:39 +01:00
25 lines
476 B
Python
25 lines
476 B
Python
|
from godot import exposed, export, Node2D
|
||
|
|
||
|
|
||
|
@exposed
|
||
|
class MyExportedCls(Node2D):
|
||
|
initialized = False
|
||
|
_python_prop = None
|
||
|
|
||
|
def _ready(self):
|
||
|
self.initialized = True
|
||
|
|
||
|
def python_method(self, attr):
|
||
|
return attr
|
||
|
|
||
|
python_prop_static = export(str)
|
||
|
|
||
|
@export(int, default=42)
|
||
|
@property
|
||
|
def python_prop(self):
|
||
|
return self._python_prop
|
||
|
|
||
|
@python_prop.setter
|
||
|
def python_prop(self, value):
|
||
|
self._python_prop = value
|