|
33 | 33 | } |
34 | 34 | _platform = sys.platform |
35 | 35 |
|
| 36 | +ENABLE_V2_0_0_FEATURE_DRAWTEXTURENPATCH = False |
| 37 | +ENABLE_V2_0_0_FEATURE_CLIPRECT = False |
| 38 | + |
| 39 | +if "ENABLE_V2_0_0_FEATURE_DRAWTEXTURENPATCH" in os.environ: |
| 40 | + ENABLE_V2_0_0_FEATURE_DRAWTEXTURENPATCH = True |
| 41 | + |
| 42 | +if "ENABLE_V2_0_0_FEATURE_CLIPRECT" in os.environ: |
| 43 | + ENABLE_V2_0_0_FEATURE_CLIPRECT = True |
36 | 44 |
|
37 | 45 | RAYLIB_BIN_PATH = None |
38 | 46 | if "RAYLIB_BIN_PATH" in os.environ: |
@@ -4077,12 +4085,15 @@ def draw_texture_pro(texture: Texture2D, source_rec: Union[Rectangle, Seq], dest |
4077 | 4085 | """Draw a part of a texture defined by a rectangle with 'pro' parameters""" |
4078 | 4086 | return _rl.DrawTexturePro(texture, _rect(source_rec), _rect(dest_rec), _vec2(origin), _float(rotation), _color(tint)) |
4079 | 4087 |
|
4080 | | -_rl.DrawTextureNPatch.argtypes = [Texture2D, NPatchInfo, Rectangle, Vector2, Float, Color] |
4081 | | -_rl.DrawTextureNPatch.restype = None |
4082 | | -def draw_texture_npatch(texture: Texture2D, npatch_info: NPatchInfo, dest_rec: Union[Rectangle, Seq], origin: Union[Vector2, Seq], rotation: float, tint: Union[Color, Seq]) -> None: |
4083 | | - """Draw a part of a texture defined by a rectangle with 'pro' parameters""" |
4084 | | - return _rl.DrawNPatch(texture, npatch_info, _rect(dest_rec), _vec2(origin), _float(rotation), _color(tint)) |
4085 | | - |
| 4088 | +if ENABLE_V2_0_0_FEATURE_DRAWTEXTURENPATCH: |
| 4089 | + _rl.DrawTextureNPatch.argtypes = [Texture2D, NPatchInfo, Rectangle, Vector2, Float, Color] |
| 4090 | + _rl.DrawTextureNPatch.restype = None |
| 4091 | + def draw_texture_npatch(texture: Texture2D, npatch_info: NPatchInfo, dest_rec: Union[Rectangle, Seq], origin: Union[Vector2, Seq], rotation: float, tint: Union[Color, Seq]) -> None: |
| 4092 | + """Draw a part of a texture defined by a rectangle with 'pro' parameters""" |
| 4093 | + return _rl.DrawNPatch(texture, npatch_info, _rect(dest_rec), _vec2(origin), _float(rotation), _color(tint)) |
| 4094 | +else: |
| 4095 | + def draw_texture_npatch(*args, **kwargs) -> None: |
| 4096 | + pass |
4086 | 4097 |
|
4087 | 4098 | # ----------------------------------------------------------------------------------- |
4088 | 4099 | # Font Loading and Text Drawing Functions (Module: text) |
@@ -4724,20 +4735,29 @@ def end_blend_mode() -> None: |
4724 | 4735 | """End blending mode (reset to default: alpha blending)""" |
4725 | 4736 | return _rl.EndBlendMode() |
4726 | 4737 |
|
4727 | | -_rl.BeginClipRec.argtypes = [Rectangle] |
4728 | | -_rl.BeginClipRec.restype = None |
4729 | | -def begin_clip_rec(rec: Rectangle) -> None: |
4730 | | - """Drawing functions change only pixels inside rec. |
4731 | | -
|
4732 | | - Can be nested. |
4733 | | - """ |
4734 | | - _rl.BeginClipRec(_rect(rec)) |
| 4738 | +if ENABLE_V2_0_0_FEATURE_CLIPRECT: |
| 4739 | + _rl.BeginClipRec.argtypes = [Rectangle] |
| 4740 | + _rl.BeginClipRec.restype = None |
| 4741 | + def begin_clip_rec(rec: Rectangle) -> None: |
| 4742 | + """Drawing functions change only pixels inside rec. |
| 4743 | +
|
| 4744 | + Can be nested. |
| 4745 | + """ |
| 4746 | + _rl.BeginClipRec(_rect(rec)) |
| 4747 | + |
| 4748 | + _rl.EndClipRec.argtypes = _NOARGS |
| 4749 | + _rl.EndClipRec.restype = None |
| 4750 | + def end_clip_rec() -> None: |
| 4751 | + """Restore previous clip rec.""" |
| 4752 | + _rl.EndClipRec() |
| 4753 | +else: |
| 4754 | + def begin_clip_rec(rec: Rectangle) -> None: |
| 4755 | + """WARNING: THIS FUNCTION HAS NO EFFECT.""" |
| 4756 | + pass |
4735 | 4757 |
|
4736 | | -_rl.EndClipRec.argtypes = _NOARGS |
4737 | | -_rl.EndClipRec.restype = None |
4738 | | -def end_clip_rec() -> None: |
4739 | | - """Restore previous clip rec.""" |
4740 | | - _rl.EndClipRec() |
| 4758 | + def end_clip_rec() -> None: |
| 4759 | + """WARNING: THIS FUNCTION HAS NO EFFECT.""" |
| 4760 | + pass |
4741 | 4761 |
|
4742 | 4762 | # VR control functions |
4743 | 4763 | _rl.GetVrDeviceInfo.argtypes = [Int] |
|
0 commit comments