WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-24-2014, 09:00 AM
chris2307 chris2307 is offline
Member
 
Join Date: Nov 2013
Posts: 36
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
Here is my default text code:
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)
During three screen mode, I run this code:
Code:
if not(screen.returnScreen() == False):
	print otherScreen
	self.text.setParent(otherScreen)

self.text.visible(viz.ON)
Can anyone see the mistake I am making?

Thanks
Reply With Quote
  #2  
Old 04-25-2014, 09:03 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
If you only want the object to show up on a specific window, then use the renderOnlyToWindows command. Example:
Code:
self.text.renderOnlyToWindows([centreWindow])
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 07:46 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC