2023-03-25 12:34:02 +08:00
|
|
|
# -------------------------------
|
|
|
|
# Difficult Rocket
|
|
|
|
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
|
|
|
|
# All rights reserved
|
|
|
|
# -------------------------------
|
|
|
|
|
2023-03-28 20:41:07 +08:00
|
|
|
"""
|
|
|
|
from .lib import (get_version_str)
|
|
|
|
|
|
|
|
from .lib import (Sprite_rs,
|
|
|
|
Vector2_rs, Vector3_rs, Vector4_rs,
|
|
|
|
Matrix3_rs, Matrix4_rs)
|
|
|
|
"""
|
2023-03-25 12:34:02 +08:00
|
|
|
from .lib import *
|
|
|
|
|
2023-03-28 23:23:50 +08:00
|
|
|
from typing import TYPE_CHECKING, Union
|
2023-03-25 12:34:02 +08:00
|
|
|
|
2023-03-28 23:23:50 +08:00
|
|
|
# noinspection PyUnresolvedReferences
|
2023-03-28 20:41:07 +08:00
|
|
|
__version__ = get_version_str()
|
|
|
|
__all__ = ['patch_sprite', 'patch_vector', 'patch_matrix', 'patch_all',
|
|
|
|
'Sprite_rs',
|
|
|
|
'Vector2_rs', 'Vector3_rs', 'Vector4_rs',
|
|
|
|
'Matrix3_rs', 'Matrix4_rs']
|
|
|
|
|
2023-03-25 12:34:02 +08:00
|
|
|
if TYPE_CHECKING:
|
|
|
|
from pyglet.event import EventDispatcher
|
|
|
|
|
2023-03-28 23:23:50 +08:00
|
|
|
Number = Union[int, float]
|
|
|
|
|
|
|
|
|
2023-03-25 20:13:17 +08:00
|
|
|
def get_version_str() -> str: ...
|
|
|
|
|
|
|
|
|
2023-03-28 19:23:41 +08:00
|
|
|
class Sprite_rs(EventDispatcher): ...
|
|
|
|
|
2023-03-28 23:23:50 +08:00
|
|
|
|
|
|
|
class Vector2_rs:
|
|
|
|
def __init__(self, x: Number, y: Number): ...
|
|
|
|
def __add__(self, other: "Vector2_rs") -> "Vector2_rs": ...
|
|
|
|
def __sub__(self, other: "Vector2_rs") -> "Vector2_rs": ...
|
|
|
|
def __mul__(self, other: "Vector2_rs") -> "Vector2_rs": ...
|
|
|
|
def __truediv__(self, other: "Vector2_rs") -> "Vector2_rs": ...
|
|
|
|
def __floordiv__(self, other: "Vector2_rs") -> "Vector2_rs": ...
|
|
|
|
def __repr__(self) -> str: ...
|
|
|
|
|
|
|
|
|
|
|
|
class Vector3_rs:
|
|
|
|
def __init__(self, x: Number, y: Number, z: Number): ...
|
|
|
|
def __add__(self, other: "Vector3_rs") -> "Vector3_rs": ...
|
|
|
|
def __sub__(self, other: "Vector3_rs") -> "Vector3_rs": ...
|
|
|
|
def __mul__(self, other: "Vector3_rs") -> "Vector3_rs": ...
|
|
|
|
def __truediv__(self, other: "Vector3_rs") -> "Vector3_rs": ...
|
|
|
|
def __floordiv__(self, other: "Vector3_rs") -> "Vector3_rs": ...
|
|
|
|
def __repr__(self) -> str: ...
|
|
|
|
|
|
|
|
|
|
|
|
class Vector4_rs:
|
|
|
|
def __init__(self, x: Number, y: Number, z: Number, w: Number): ...
|
|
|
|
def __add__(self, other: "Vector4_rs") -> "Vector4_rs": ...
|
|
|
|
def __sub__(self, other: "Vector4_rs") -> "Vector4_rs": ...
|
|
|
|
def __mul__(self, other: "Vector4_rs") -> "Vector4_rs": ...
|
|
|
|
def __truediv__(self, other: "Vector4_rs") -> "Vector4_rs": ...
|
|
|
|
def __floordiv__(self, other: "Vector4_rs") -> "Vector4_rs": ...
|
|
|
|
def __repr__(self) -> str: ...
|
|
|
|
|
2023-03-28 19:23:41 +08:00
|
|
|
|
|
|
|
class Matrix3_rs: ...
|
2023-03-28 23:23:50 +08:00
|
|
|
|
|
|
|
|
2023-03-28 19:23:41 +08:00
|
|
|
class Matrix4_rs: ...
|
2023-03-25 20:13:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
def patch_sprite():
|
|
|
|
from pyglet import sprite
|
|
|
|
sprite.Sprite = Sprite_rs
|
2023-03-28 19:23:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
def patch_vector():
|
|
|
|
from pyglet import math
|
|
|
|
math.Vector2 = Vector2_rs
|
|
|
|
math.Vector3 = Vector3_rs
|
|
|
|
math.Vector4 = Vector4_rs
|
|
|
|
|
|
|
|
|
|
|
|
def patch_matrix():
|
|
|
|
from pyglet import math
|
|
|
|
math.Matrix3 = Matrix3_rs
|
|
|
|
math.Matrix4 = Matrix4_rs
|
|
|
|
|
|
|
|
|
|
|
|
def patch_all():
|
|
|
|
patch_sprite()
|
|
|
|
patch_vector()
|
|
|
|
patch_matrix()
|