Пример #1
0
 def xform(self, v):
     if isinstance(v, Vector2):
         raw = lib.godot_transform2d_xform_vector2(self._gd_ptr, v._gd_ptr)
         return Vector2.build_from_gdobj(raw)
     elif isinstance(v, Rect2):
         raw = lib.godot_transform2d_xform_rect2(self._gd_ptr, v._gd_ptr)
         return Rect2.build_from_gdobj(raw)
     raise TypeError('Param `v` should be of type `Rect2` or `Vector2`')
Пример #2
0
 def get_scale(self):
     raw = lib.godot_transform2d_get_scale(self._gd_ptr)
     return Vector2.build_from_gdobj(raw)
Пример #3
0
 def size(self):
     return Vector2.build_from_gdobj(lib.godot_rect2_get_size(self._gd_ptr))
Пример #4
0
 def basis_xform_inv(self, v):
     self._check_param_type('v', v, Vector2)
     raw = lib.godot_transform2d_basis_xform_inv_vector2(
         self._gd_ptr, v._gd_ptr)
     return Vector2.build_from_gdobj(raw)
Пример #5
0
 def position(self):
     return Vector2.build_from_gdobj(
         lib.godot_rect2_get_position(self._gd_ptr))