I want to see the current co-ordinates using current coordinates so i am using the following code but the text is overlapping so how do i coorect this?
What I’d suggest is that, instead of creating a new OnscreenText for each update, you create just one during initialisation, and then alter its text as called for. Something like this (using a simplified example for convenience and clarity):
def __init__(self):
# ... Other initialisation here ...
# Create our OnscreenText object:
self.coordinateDisplay = OnscreenText(text = "",
mayChange = True,
scale = 0.05)
# Start up our task:
self.taskMgr.add(self.updateCoordDisplay, "update coord display")
def updateCoordDisplay(self, task):
# Get our new text...
coordText = str(self.pd.getPos())
# ... And set our OnscreenText object to display it:
self.coordinateDisplay.setText(coordText)
return task.cont