This is a lightly modified version of the LDtk quicktype loader to make it compatible with pocketpy (tested with 2.1.6).
The main change is the from_enum function to support mapping string values from JSON to enum objects.
| [Object] | |
| ; All the actual object definition | |
| ; ... | |
| OnCreate = > @, Input.EnableSet < true | |
| OnDelete = > @, Input.EnableSet < false | |
| ; Game event handlers | |
| EventHandlerList= DropperEvents | |
| ; Inputs |
| [Inspector] | |
| Shader = Outline | |
| [Outline] | |
| UseCustomParam = true | |
| ParamList = texture # time # highlight | |
| time = time 3.1415926 | |
| highlight = (1, 1, 1) | |
| Code = " | |
| uniform float width = 5.0; |
| import pkpy | |
| class Rpc[A, R]: | |
| def __init__(self, vm: pkpy.ComputeThread, function: str) -> None: | |
| self._vm = vm | |
| self._function = function | |
| def call(self, arg: A) -> None: | |
| if not self._vm.is_done: | |
| raise ValueError("vm is busy") |
This is a lightly modified version of the LDtk quicktype loader to make it compatible with pocketpy (tested with 2.1.6).
The main change is the from_enum function to support mapping string values from JSON to enum objects.