setPos does indeed work, but the entire screen is only in the range -1 … 1, so setting it to (-5, -5) will move it completely offscreen. Also, it has to be a 3-d coordinate, even though the Y component is not used. Try something more like (-0.5, 0, -0.5).
Now is there a way to have it redraw it if you change the size of the screen? If I drag the window size when it’s running it seems to slide towards the center of the screen.
I tried adding setPos to the task that runs every second, but that didn’t seem to do it.
You can listen for the event named “window-event”, which is thrown any time the window changes size (or other properties).
Or, you can simply parent your text to base.a2dTopLeft or any of the other corners or edge names as described in the manual, and it will automatically follow the corner or edge.
Ahh, I was trying to do it on the textNode itself, not the textnodepath.
I used your code and it works perfectly, but the text is appearing just outside the frame (you can just see the bottom edge of it in the top-left corner in the pic above).
What do I need to add so it’s down like 10 units in both the X and Y axis from it’s position?
When the textnode position’s aspect2d y coordinate is set to 1 or the textnode is parented to a2dTopLeft, part of the text is occluded by the top window border.
I wonder if the textnode placement mechanism on the aspect2d considers the window decorations as part of the frame? Or is it an OS level issue?
1 is the top of the screen. When you set the position to 1, you are setting the baseline of the text (the imaginary line on which the text rests) to the top of the screen, so most of the text is off the screen, except for the bottom parts of lowercase letters and punctuation marks that are visible below the baseline.
So you should set text position to less than 1.0 if you wish it to be visible.
The same is true for a2dTopLeft; in this case the 0.0 value is the top of the screen. If you use a2dTopLeft you have to set the text to a negative y position in order for it to be visible.
The placement of the title bars has nothing to do with it.