Open MarioMey opened 2 years ago
Also (as in here), it does exist but it is not writable:
from godot import exposed, export, Area2D, Transform2D, Vector2
@exposed
class Coso(Area2D):
def _ready(self):
t = Transform2D()
t.origin = Vector2(350, 150)
self.transform = t
Console:
Traceback (most recent call last):
File "build/x11-64/pythonscript/_godot_instance.pxi", line 98, in _godot.pythonscript_instance_call_method
File "/home/mariomey/md-godot/test/TestTransform2D.py", line 9, in _ready
s.origin = Vector2(350, 150)
AttributeError: attribute 'origin' of 'godot.builtins.Transform2D' objects is not writable
By trying the first code of the Matrixes and Transformation documentation, I do this:
... and I get this:
So, the only way (I found) to achieve exactly the same, is:
Why we can't modify a
Transform2D
object as in GDScript?