|
@@ -8,6 +8,7 @@ __all__ = ['OnscreenText', 'Plain', 'ScreenTitle', 'ScreenPrompt', 'NameConfirm'
|
|
|
|
|
|
|
|
from panda3d.core import *
|
|
from panda3d.core import *
|
|
|
from . import DirectGuiGlobals as DGG
|
|
from . import DirectGuiGlobals as DGG
|
|
|
|
|
+import warnings
|
|
|
|
|
|
|
|
## These are the styles of text we might commonly see. They set the
|
|
## These are the styles of text we might commonly see. They set the
|
|
|
## overall appearance of the text according to one of a number of
|
|
## overall appearance of the text according to one of a number of
|
|
@@ -304,6 +305,8 @@ class OnscreenText(NodePath):
|
|
|
.. deprecated:: 1.11.0
|
|
.. deprecated:: 1.11.0
|
|
|
Use `.setTextX()` method instead.
|
|
Use `.setTextX()` method instead.
|
|
|
"""
|
|
"""
|
|
|
|
|
+ if __debug__:
|
|
|
|
|
+ warnings.warn("Use `.setTextX()` method instead.", DeprecationWarning, stacklevel=2)
|
|
|
self.setTextPos(x, self.__pos[1])
|
|
self.setTextPos(x, self.__pos[1])
|
|
|
|
|
|
|
|
def setTextY(self, y):
|
|
def setTextY(self, y):
|
|
@@ -317,6 +320,8 @@ class OnscreenText(NodePath):
|
|
|
.. deprecated:: 1.11.0
|
|
.. deprecated:: 1.11.0
|
|
|
Use `.setTextY()` method instead.
|
|
Use `.setTextY()` method instead.
|
|
|
"""
|
|
"""
|
|
|
|
|
+ if __debug__:
|
|
|
|
|
+ warnings.warn("Use `.setTextY()` method instead.", DeprecationWarning, stacklevel=2)
|
|
|
self.setTextPos(self.__pos[0], y)
|
|
self.setTextPos(self.__pos[0], y)
|
|
|
|
|
|
|
|
def setTextPos(self, x, y=None):
|
|
def setTextPos(self, x, y=None):
|
|
@@ -346,6 +351,8 @@ class OnscreenText(NodePath):
|
|
|
.. deprecated:: 1.11.0
|
|
.. deprecated:: 1.11.0
|
|
|
Use `.setTextPos()` method or `.text_pos` property instead.
|
|
Use `.setTextPos()` method or `.text_pos` property instead.
|
|
|
"""
|
|
"""
|
|
|
|
|
+ if __debug__:
|
|
|
|
|
+ warnings.warn("Use `.setTextPos()` method or `.text_pos` property instead.", DeprecationWarning, stacklevel=2)
|
|
|
self.__pos = (x, y)
|
|
self.__pos = (x, y)
|
|
|
self.updateTransformMat()
|
|
self.updateTransformMat()
|
|
|
|
|
|
|
@@ -354,6 +361,8 @@ class OnscreenText(NodePath):
|
|
|
.. deprecated:: 1.11.0
|
|
.. deprecated:: 1.11.0
|
|
|
Use `.getTextPos()` method or `.text_pos` property instead.
|
|
Use `.getTextPos()` method or `.text_pos` property instead.
|
|
|
"""
|
|
"""
|
|
|
|
|
+ if __debug__:
|
|
|
|
|
+ warnings.warn("Use `.getTextPos()` method or `.text_pos` property instead.", DeprecationWarning, stacklevel=2)
|
|
|
return self.__pos
|
|
return self.__pos
|
|
|
|
|
|
|
|
pos = property(getPos)
|
|
pos = property(getPos)
|
|
@@ -379,6 +388,8 @@ class OnscreenText(NodePath):
|
|
|
.. deprecated:: 1.11.0
|
|
.. deprecated:: 1.11.0
|
|
|
Use ``setTextR(-roll)`` instead (note the negated sign).
|
|
Use ``setTextR(-roll)`` instead (note the negated sign).
|
|
|
"""
|
|
"""
|
|
|
|
|
+ if __debug__:
|
|
|
|
|
+ warnings.warn("Use ``setTextR(-roll)`` instead (note the negated sign).", DeprecationWarning, stacklevel=2)
|
|
|
self.__roll = roll
|
|
self.__roll = roll
|
|
|
self.updateTransformMat()
|
|
self.updateTransformMat()
|
|
|
|
|
|
|
@@ -387,6 +398,8 @@ class OnscreenText(NodePath):
|
|
|
.. deprecated:: 1.11.0
|
|
.. deprecated:: 1.11.0
|
|
|
Use ``-getTextR()`` instead (note the negated sign).
|
|
Use ``-getTextR()`` instead (note the negated sign).
|
|
|
"""
|
|
"""
|
|
|
|
|
+ if __debug__:
|
|
|
|
|
+ warnings.warn("Use ``-getTextR()`` instead (note the negated sign).", DeprecationWarning, stacklevel=2)
|
|
|
return self.__roll
|
|
return self.__roll
|
|
|
|
|
|
|
|
roll = property(getRoll, setRoll)
|
|
roll = property(getRoll, setRoll)
|
|
@@ -424,7 +437,8 @@ class OnscreenText(NodePath):
|
|
|
.. deprecated:: 1.11.0
|
|
.. deprecated:: 1.11.0
|
|
|
Use `.setTextScale()` method or `.text_scale` property instead.
|
|
Use `.setTextScale()` method or `.text_scale` property instead.
|
|
|
"""
|
|
"""
|
|
|
-
|
|
|
|
|
|
|
+ if __debug__:
|
|
|
|
|
+ warnings.warn("Use `.setTextScale()` method or `.text_scale` property instead.", DeprecationWarning, stacklevel=2)
|
|
|
if sy is None:
|
|
if sy is None:
|
|
|
if isinstance(sx, tuple):
|
|
if isinstance(sx, tuple):
|
|
|
self.__scale = sx
|
|
self.__scale = sx
|
|
@@ -439,6 +453,8 @@ class OnscreenText(NodePath):
|
|
|
.. deprecated:: 1.11.0
|
|
.. deprecated:: 1.11.0
|
|
|
Use `.getTextScale()` method or `.text_scale` property instead.
|
|
Use `.getTextScale()` method or `.text_scale` property instead.
|
|
|
"""
|
|
"""
|
|
|
|
|
+ if __debug__:
|
|
|
|
|
+ warnings.warn("Use `.getTextScale()` method or `.text_scale` property instead.", DeprecationWarning, stacklevel=2)
|
|
|
return self.__scale
|
|
return self.__scale
|
|
|
|
|
|
|
|
scale = property(getScale, setScale)
|
|
scale = property(getScale, setScale)
|