#1
|
|||
|
|||
Displaying Text on new Window
Hi all,
I have an application which can either run in single screen mode or three screen mode. Single screen mode uses viz.MainView only and three screen mode, I use three custom windows. My only problem is when I attempt to display text in the centre of the application. The parent of the text by default is viz.SCREEN. I attempt to reset this if I am in three screen mode to the centre screen. Unfortunately, I don't see the text. I don't get errors either. Screen Code: Code:
# The following is also done for the left window and right window. centreWindow = viz.add(viz.WINDOW) centreWindow.setPosition(1.0/3, 1.0) centreWindow.setSize(1.0/3, 1.0) centreWindow.visible(0,viz.SCREEN) centreWindow.fov(fieldOfView,aspectRatio) centreView = viz.add(viz.VIEWPOINT) centreWindow.setView(centreView) def returnScreen(): if(threeScreen): return centreWindow else: return False Code:
self.trialInstructions = "TEXT" self.text = viz.addText(self.trialInstructions, parent=viz.SCREEN) self.text.color(viz.WHITE) self.text.setPosition(0.5,0.5) self.text.alignment(viz.ALIGN_CENTER_CENTER) self.text.fontSize(40) self.text.visible(viz.OFF) Code:
if not(screen.returnScreen() == False): print otherScreen self.text.setParent(otherScreen) self.text.visible(viz.ON) Thanks |
#2
|
|||
|
|||
If you only want the object to show up on a specific window, then use the renderOnlyToWindows command. Example:
Code:
self.text.renderOnlyToWindows([centreWindow]) |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
input from a text file | dig | Vizard | 5 | 10-20-2013 01:20 AM |
Window always on top | madeinjava | Vizard | 4 | 08-27-2013 02:10 PM |
Unexpected Change of Window Size | javadi | Vizard | 7 | 07-23-2013 02:56 PM |
winviz in Vizard 4and displaying a console window | Enlil | Vizard | 2 | 02-22-2012 02:35 PM |
Informationboxes with text | snoopy78 | Vizard | 3 | 07-16-2009 10:23 AM |