当前位置: 首页>>代码示例>>Python>>正文


Python viz.addText函数代码示例

本文整理汇总了Python中viz.addText函数的典型用法代码示例。如果您正苦于以下问题:Python addText函数的具体用法?Python addText怎么用?Python addText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了addText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

	def __init__(self):
		#init canvas and create themes for the test panel
		self.canvas = viz.addGUICanvas(align = viz.ALIGN_CENTER_CENTER)
		self.canvas.setPosition(0,0,0)
		viz.mouse.setVisible(False)
		self.name = 'test'
		self._theme = viz.Theme()
		self._theme.borderColor = (0.1,0.1,0.1,1)
		self._theme.backColor = (0.4,0.4,0.4,1)
		self._theme.lightBackColor = (0.6,0.6,0.6,1)
		self._theme.darkBackColor = (0.2,0.2,0.2,1)
		self._theme.highBackColor = (0.2,0.2,0.2,1)
		self._theme.textColor = (1,1,1,1)
		self._theme.highTextColor = (1,1,1,1)
		
		#initialize test panel
		vizdlg.Panel.__init__(self, parent = self.canvas, theme = self._theme, align = viz.ALIGN_CENTER_TOP, fontSize = 15)
		self.visible(viz.OFF)
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
		self.alpha(0.6)
		
#		#title
		title = vizdlg.TitleBar('INSTRUCTIONS')
		self.addItem(title, align = viz.ALIGN_CENTER_TOP)
		
		#bones to be snapped. source snapped to target.
		source = 'a'*20
		self.sourceText = viz.addTextbox(parent = self.canvas)
		self.sourceText.setLength(1.5)
		target = 'a'*20
		self.targetText = viz.addTextbox(parent = self.canvas)
		self.targetText.setLength(1.5)
		
		#instructions 
		self.Instruct1 = self.addItem(viz.addText('Snap the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.sourceCommand = self.addItem(self.sourceText, align = viz.ALIGN_CENTER_TOP)
		self.Instruct2 = self.addItem(viz.addText('To the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.targetCommand = self.addItem(self.targetText, align = viz.ALIGN_CENTER_TOP)
		
		#render canvas
		
		if config.dispMode == config.DisplayMode.monitor:
			self.canvas.billboard(viz.BILLBOARD_YAXIS)
			self.canvas.setPosition(-2,0,0)
			self.canvas.setBackdrop(viz.ALIGN_CENTER_TOP)
			

		if config.dispMode == config.DisplayMode.oculus:

			bb = self.canvas.getBoundingBox()
			self.canvas.setRenderWorldOverlay([bb.width*1, bb.height*1], fov = bb.height, distance = 0.4)
			self.canvas.setPosition(0,0.05,0)
			self.canvasViewPos = self.canvas.getPosition()
			self.canvas.setEuler(0,15,0)
			self.canvas.setPosition(0, -5, 0)
			self.canvasHidePos = self.canvas.getPosition()
			viztask.schedule(self.updatePanelPos())
			
		vizact.onkeydown(viz.KEY_ESCAPE, self.toggle)
开发者ID:erikmessier,项目名称:anatomy-puzzle,代码行数:59,代码来源:view.py

示例2: ShowTotalScore

	def ShowTotalScore (self):
		#add third row with the total score if not added already
		try:
			self._total.alignment(viz.ALIGN_RIGHT_BASE)
		except:
			row3text = viz.addText(self.tooltips['score'])
			row3text.font("Segoe UI")
			row3icon = viz.addTexQuad(size=25, texture=viz.add('textures/total_icon.png'))
			self._total= viz.addText('000')
			self._total.font("Segoe UI")
			self._total.alignment(viz.ALIGN_RIGHT_BASE)
			self._scorePanel.addRow([row3icon, row3text, self._total])
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:12,代码来源:Window.py

示例3: __init__

	def __init__(self, fig):
		self.canvasData = viz.Data(lock = threading.Lock(), havenewData=False )	
		self.fig = fig
		self.t = threading.Thread(target=self.computeFigureThread)
		self.t.start()

		#IMPORTANT: Wait for thread to finish before exiting
		vizact.onexit(self.t.join)
		#Create a blank texture to display canvas data
		self.tex = viz.addBlankTexture([1,1])
		#Create onscreen quad to display texture
		self.quad = viz.addTexQuad(parent=viz.ORTHO,texture=self.tex)
		self.quad.alpha(0.5)
		self.link = viz.link(viz.MainWindow.CenterCenter,self.quad)
	#	self.link.setOffset([400,200,0])
		self.drawer = vizact.ontimer(0, self.drawPlot)
		self.rate_ctr = time.time()
		self.drawrate_txt = viz.addText('', viz.SCREEN)
		self.drawrate_txt.setPosition(0,0.01)
		self.drawrate_txt.scale(.7,.7)
		self.drawrate_txt.color(viz.WHITE)
		self.drawrate_txt.visible(0)
		self.rate = 0
		#scale variables to change size of plot image
		self.scale_x = 1
		self.scale_y = 1
开发者ID:awellis,项目名称:SVV,代码行数:26,代码来源:vizmatplot.py

示例4: displayInputPanel

def displayInputPanel():
	global inputPanel, names
	
	inputPanel = viz.addGUIGroup()
#	endG = viz.addGroup(viz.SCREEN)
	splashScreen = viz.addTexQuad(parent=viz.SCREEN,pos=[0.5,0.5,0],scale=[13,10.5,1])
	splashScreen.texture(viz.addTexture('textures/splash_screen'+LANG+'.jpg'))
	splashScreen.setParent(inputPanel)
	names = []
	pl = range(condition%2*2+1)
	pl.reverse()
	for i,p in enumerate(pl):
		name = viz.addTextbox()
		nameText = {'':'Player %s name:', 'GR':'Όνομα παίκτη %s:'}
		title = viz.addText(nameText[LANG]%str(i+1), viz.SCREEN)
		title.fontSize(24)
		title.addParent(inputPanel)
		title.setPosition([.4, .53+.1*p, 0])
		name.setPosition([.5, .5+.1*p, 0])
		name.addParent(inputPanel)
		names.append(name)
	startB = viz.addButtonLabel('START')
	startB.setPosition(.5,.4)
	startB.addParent(inputPanel)
	vizact.onbuttonup(startB, initialize)
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:25,代码来源:OLiVE.py

示例5: strippedTrialTask

def strippedTrialTask(avatar, turningAngle, vLinear, tLegs, idxTrial, output = {}):
	"""
	master task that invokes all other tasks as subtasks to ensure right order
	"""
	# add text for instructions
	screenText = viz.addText('trial no. '+str(idxTrial),viz.SCREEN)
	screenText.setBackdrop(viz.BACKDROP_RIGHT_BOTTOM)
	screenText.setBackdropColor(viz.GRAY)
	screenText.setPosition(0.05, 0.5)
	
	# wait for key press and execute trial
	yield viztask.waitKeyDown(' ')
	screenText.message('')
	passage = passageAction(turningAngle, vLinear, tLegs)
	avatar.addAction(passage)
	yield viztask.waitActionEnd(avatar, passage)
	
	# get homing vectors
	yield helperFunctions.saveHomingVectors(avatar, output)
	print output
	
	# post trial instructions & position reset
	yield viztask.waitTime(0.2)
	screenText.message('please select your\nanswer for trial '+str(idxTrial))
	yield viztask.waitKeyDown(' ')
	screenText.remove()
	yield helperFunctions.resetTask(avatar)
开发者ID:leftbigtoe,项目名称:starfield,代码行数:27,代码来源:classroomTrials.py

示例6: __init__

	def __init__(self):
			

		self.targetNumber = 3
		self.maxNum = 7
		
		self.buffSize  = 7
		self.updateRateSecs = 0.75
		
		self.nextBuffer  = np.array([])
		self.lastBuffer = []
		
		while(self.nextBuffer.size < self.buffSize):
			self.addInt()
		
		self.textObj = viz.addText('',parent=viz.SCREEN)
		self.textObj.setPosition(0.5,0.5)
		self.textObj.color(viz.WHITE)
		self.textObj.alignment( viz.ALIGN_CENTER_CENTER) 
		self.textObj.fontSize(1000)
		
		self.targetTimer = []
		self.updateAction  = vizact.ontimer(self.updateRateSecs,self.presentNumber)
		
		self.stopPresentingNumbers()
		
		print 'Ready. To start countdown, run <numberCount>.startPresentingNumbers()' 
开发者ID:performlabrit,项目名称:NumberDetectionTask,代码行数:27,代码来源:numberTask.py

示例7: loadStuff

def loadStuff():
	globals_oa.loadScavengerHuntAssetsCalled = True
#	
	globals_oa.basket = vizfx.addChild(EQUIPMENT_DIRECTORY + 'diveBasketslate.osgb')
	#globals_oa.basket = vizfx.addChild(EQUIPMENT_DIRECTORY + 'diveBasket.osgb')
	#globals_oa.basket.setScale([0.75, 0.85, 0.75]) old basket scale, no shelf
	globals_oa.basket.setScale([0.65, 0.75, 0.65])
	globals_oa.basket.billboard(viz.BILLBOARD_YAXIS)
	globals_oa.slate = globals_oa.basket.getChild('Slate_New.OSGB')
#	globals_oa.slate = vizfx.addChild(EQUIPMENT_DIRECTORY + 'Slate_New.osgb')
#	globals_oa.slate.visible(False)
	
	global pics
	pics = []
	pics.append( viz.addTexture('resources/Ocinebrina Edwardsii_Zone' + str(globals_oa.currentZoneNumber) + '.png') )
	pics.append( viz.addTexture('resources/Octopus_2D.png') )
	pics.append( viz.addTexture('resources/Eel_2D.png') )
	pics.append( viz.addTexture('resources/seagrass.jpg') ) # Get picture of seagrass
	
	global time_text
	time_text = viz.addText3D('', pos = [0, 0, 0])
	time_text.visible(False)
	
	global count_text1
	global count_text2
	global count_text3
	global quad1
	global quad2
	global quad3
	
	quad1 = viz.addTexQuad(size = 0.15)
	quad2 = viz.addTexQuad(size = 0.15)
	quad3 = viz.addTexQuad(size = 0.15)
	count_text1 = viz.addText('found: 0')
	count_text2 = viz.addText('found: 0')
	count_text3 = viz.addText('found: 0')
	
#	quad1.disable(viz.LIGHTING)
#	quad2.disable(viz.LIGHTING)
#	quad3.disable(viz.LIGHTING)
	quad1.disable(viz.FOG)
	quad2.disable(viz.FOG)
	quad3.disable(viz.FOG)
	
	hideBasketAndStuffAttachedToIt()
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:45,代码来源:scavengerhunt.py

示例8: __init__

	def __init__(self, canvas, controller):
		super(ModeMenu, self).__init__(canvas, 'mode', 'Mode Selection')
		
		# Store controller instance
		self.controller = controller
		
		#Store modes from config to populate modemenu with
		self.modes = config.MenuConfig.Modes
		self.getPanel().fontSize(50)
		
		##########################
		"""creating modes panel"""
		##########################
		
		#creating labels for modes
		self.modeLabels = {}
		
		for l in self.modes.iterkeys():
			self.modeLabels[l] = viz.addText(l, parent = canvas)
		
		#creating radio buttons for modes
		self.modeGroup = viz.addGroup(parent = canvas)
		self.radioButtons = {}
		
		for rb in self.modes.iterkeys():
			self.radioButtons[rb] = viz.addRadioButton(self.modeGroup, parent = canvas)
		
		self.radioButtons['Free Play'].set(1)
		
		#creating grid panel to add mode to
		modeGrid = vizdlg.GridPanel(parent = canvas)
		
		#adding modes and radio buttons to grid panel
		for i in self.modes.iterkeys():
			modeGrid.addRow([self.modeLabels[i], self.radioButtons[i]])
		
		##############################
		"""next and back buttons"""
		##############################
		
		#creating grid panels to add next and back buttons to
		setGrid = vizdlg.GridPanel(parent = canvas)
		
		#create back and next buttons and add to grid panel
		backButton = viz.addButtonLabel('Back')
		startButton = viz.addButtonLabel('Next')
		setGrid.addRow([backButton, startButton])
		
		#add back and state button actions
		self.backward = vizact.onbuttondown(backButton, self.controller.backMenu)
		self.forward = vizact.onbuttondown(startButton, self.controller.nextMenu)
		
		###############################
		"""add items to ModeMenu"""
		###############################
		self.addItem(modeGrid)
		self.addItem(setGrid)
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:57,代码来源:menu.py

示例9: __init__

	def __init__(self):
		"""Init canvas and create themes for the test panel"""
		self.canvas = viz.addGUICanvas(parent = viz.ABS_GLOBAL)
		viz.mouse.setVisible(False)
		self.name = 'test'
		
		self._theme					= viz.Theme()
		self._theme.borderColor		= (0.1,0.1,0.1,1)
		self._theme.backColor		= (0.4,0.4,0.4,1)
		self._theme.lightBackColor	= (0.6,0.6,0.6,1)
		self._theme.darkBackColor	= (0.2,0.2,0.2,1)
		self._theme.highBackColor	= (0.2,0.2,0.2,1)
		self._theme.textColor		= (1,1,1,1)
		self._theme.highTextColor	= (1,1,1,1)
		
		# Initialize test panel
		vizdlg.Panel.__init__(self, parent = self.canvas, theme = self._theme, align = viz.ALIGN_CENTER, fontSize = 10)
		self.visible(viz.OFF)
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
		
		# Title
		title = vizdlg.TitleBar('INSTRUCTIONS')
		self.addItem(title, align = viz.ALIGN_CENTER_TOP)
		
		# Bones to be snapped. source snapped to target.
		self.sourceText = viz.addTextbox(parent = self.canvas)
		self.sourceText.setLength(1.5)
		self.targetText = viz.addTextbox(parent = self.canvas)
		self.targetText.setLength(1.5)
		
		# Instructions 
		self.Instruct1		= self.addItem(viz.addText('Snap the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.sourceCommand	= self.addItem(self.sourceText, align = viz.ALIGN_CENTER_TOP)
		self.Instruct2		= self.addItem(viz.addText('To the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.targetCommand	= self.addItem(self.targetText, align = viz.ALIGN_CENTER_TOP)
		
		# Render canvas
		bb = self.getBoundingBox()
		self.canvas.setRenderWorld([bb.height, bb.width],[4, 3*1.333])
		
		# On esc toggle menu (doesn't interfere with in-game menu)
#		vizact.onkeydown(viz.KEY_ESCAPE, self.toggle)
		self.canvas.setPosition(0.0,2.0,4.0)
		self.canvas.resolution(self.canvas.getResolution())
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:44,代码来源:puzzleView.py

示例10: CreateScorePanel

	def CreateScorePanel(self):
		self._newScore = None	#holds the temp score after each update
		self._scorePanel = vizdlg.GridPanel(window=self._window, skin=vizdlg.ModernSkin, 
					spacing=-10, align=vizdlg.ALIGN_RIGHT_TOP, margin=0)
		row1text = viz.addText(self.tooltips['points'])
		row1text.font("Segoe UI")
		self._scoreIcon = viz.addTexQuad(size=25, texture=viz.add('textures/star_yellow_256.png'))
		self._score= viz.addText('000')
		self._score.font("Segoe UI")
		self._score.alignment(viz.ALIGN_RIGHT_BASE)
		self._scorePanel.addRow([self._scoreIcon, row1text, self._score])
		row2text = viz.addText(self.tooltips['oil'])
		row2text.font("Segoe UI")
		self._oilIcon = viz.addTexQuad(size=25, texture=viz.add('textures/oil_icon.png'))
		self._oil= viz.addText('000')
		self._oil.font("Segoe UI")
		self._oil.alignment(viz.ALIGN_RIGHT_BASE)
		self._scorePanel.addRow([self._oilIcon, row2text, self._oil])
		self._scorePanel.setCellAlignment(vizdlg.ALIGN_RIGHT_TOP)
		#place the score board at the top right corner of the window
		viz.link(self._window.RightTop, self._scorePanel, offset=(-10,-45,0))
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:21,代码来源:Window.py

示例11: AddPanel

	def AddPanel(self, langu):
		self._hud = viz.addGroup(viz.ORTHO, scene=self._window)
		panel = viz.addTexQuad(parent=viz.ORTHO, scene=self._window, size=200)
		panel.texture(viz.addTexture('textures/panel.png', useCache = True))
		panel.setParent(self._hud)
		self.tag = viz.addTexQuad(parent=viz.ORTHO, scene=self._window, size=200)
		self.tag.texture(viz.addTexture('textures/p'+str(self._player)+'_tag.png', useCache = True))
		self.tag.setParent(self._hud)
		#add the player name as a child of the panel
		self._name = viz.addText(self._name, panel)
		self._name.alignment(viz.ALIGN_CENTER_TOP)
		self._name.font("Segoe UI")
		self._name.color(viz.BLACK)
		self._name.fontSize(14)
		self._name.resolution(.5)
		self._name.setScale(1.5,.75,1)
		self._name.setPosition(3,92,0)
		self._name.setParent(self._hud)
		#add the user feedback message
		self._message = viz.addText('', viz.ORTHO, self._window)
		self._message.alignment(viz.ALIGN_LEFT_TOP)
		self._message.font("Segoe UI")
		self._message.color(viz.BLACK)
		self._message.fontSize(13)
		self._message.resolution(.5)
		self._message.setScale(1.5,.75,1)
		self._message.setPosition(-80,32,0)
		self._message.setParent(self._hud)
		#add the collab icon
		self._collabTextures = [viz.add('textures/signs'+langu+'/collab0.png'), viz.add('textures/signs'+langu+'/collab1.png')]
		self._collabIcon = viz.addTexQuad(parent=viz.ORTHO, scene=self._window, size=150)
		self._collabIcon.texture(self._collabTextures[0])
		self._collabIcon.setParent(self._hud)
		self._collabIcon.drawOrder(20)
		self._collabIcon.setPosition(0, -65, 10)
		self._collabIcon.setScale(1,.4,1)
		self._collabIcon.alpha(0)
		self.ResizePanel()
		#add the info panels
		self.CreateInfoPanels()
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:40,代码来源:Window.py

示例12: __init__

	def __init__(self):
#		self.statsPanel = vizinfo.InfoPanel(title='Inspector',text=None,align=viz.ALIGN_CENTER_BASE,icon=False)
#		self.statsPanel.getTitleBar().fontSize(16)
#		self.diameter_stat = viz.addText('d (mm)')
#		self.statsPanel.addItem(self.diameter_stat)
#		self.thickness_stat = viz.addText('t (mm)')
#		self.statsPanel.addItem(self.thickness_stat)
#		self.length_stat = viz.addText('l (m)')
#		self.statsPanel.addItem(self.length_stat)
#		self.rotation_stat = viz.addText('angle')
#		self.statsPanel.addItem(self.rotation_stat)
		
		self.statsPanel = vizdlg.Panel(align=viz.ALIGN_CENTER_TOP,border=False)
		self.statsMsg = self.statsPanel.addItem(viz.addText('Highlight member to inspect element'))
开发者ID:justlim77,项目名称:TrussBridgeBuilder,代码行数:14,代码来源:panels.py

示例13: multipleTrialTask

def multipleTrialTask(avatar, angles):
	"""
	function to call multiple trials (needs to be a task to ensure proper time course)
	"""
	counter = 1
	for angle in trialDict['turningAngles']:
		output = {}
		yield viztask.waitTask(strippedTrialTask(avatar, angle, trialDict['vLinear'], 
												 trialDict['tLegs'], counter))
		counter+=1
	# add text for instructions
	screenText = viz.addText('please open and fill out\nthe questionnaires now',viz.SCREEN)
	screenText.setBackdrop(viz.BACKDROP_RIGHT_BOTTOM)
	screenText.setBackdropColor(viz.GRAY)
	screenText.setPosition(0.05, 0.5)
开发者ID:leftbigtoe,项目名称:starfield,代码行数:15,代码来源:classroomTrials.py

示例14: BlendEffect

flash_quad.drawOrder(-10)
flash_quad.blendFunc(viz.GL_ONE,viz.GL_ONE)
flash_quad.visible(False)
viz.link(viz.MainWindow.WindowSize,flash_quad,mask=viz.LINK_SCALE)

# Create status bar background
status_bar = viz.addTexQuad(parent=viz.ORTHO)
status_bar.color(viz.BLACK)
status_bar.alpha(0.5)
status_bar.alignment(viz.ALIGN_LEFT_BOTTOM)
status_bar.drawOrder(-1)
viz.link(viz.MainWindow.LeftTop,status_bar,offset=[0,-80,0])
viz.link(viz.MainWindow.WindowSize,status_bar,mask=viz.LINK_SCALE)

# Create time limit text
time_text = viz.addText('',parent=viz.ORTHO,fontSize=40)
time_text.alignment(viz.ALIGN_CENTER_TOP)
time_text.setBackdrop(viz.BACKDROP_OUTLINE)
viz.link(viz.MainWindow.CenterTop,time_text,offset=[0,-20,0])

# Create score text
score_text = viz.addText('',parent=viz.ORTHO,fontSize=40)
score_text.alignment(viz.ALIGN_LEFT_TOP)
score_text.setBackdrop(viz.BACKDROP_OUTLINE)
viz.link(viz.MainWindow.LeftTop,score_text,offset=[20,-20,0])

# Create post process effect for blending to gray scale
gray_effect = BlendEffect(None,GrayscaleEffect(),blend=0.0)
gray_effect.setEnabled(False)
vizfx.postprocess.addEffect(gray_effect)
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:30,代码来源:D2C3.py

示例15: camera

yaw = 0
yawB = 0
yaws = []
yawsB = []
aveYaw = 0
aveYawB = 0
quadrant = 0 # 0,1,2,3
flag_out = 0 # turn on when camera A can't detect yaw
flag_outB = 0 #turn on when camera B can't detect yaw
flag_clockwise = 0
flag_side_cam = 0 #turn on when using side camera (B)
YAW_SIZE = 20
finalYaw = 0
finalYaws = []
aveFinalYaw = 0
text1 = viz.addText("Start walking")

stepCount = 0
mainYaw = 0
output2file = 1
now = datetime.datetime.now()
counter = 0
filename = '../bin/Output files/output {}-{} {},{},{}.csv'.format(now.month,now.day,now.hour,now.minute,now.second)
''' ********************* End of Initializations ************************ '''


def setDown():
	global prevStep
	prevStep = "DOWN"
	viz.MainView.velocity(0,0,0)
开发者ID:cstrachan88,项目名称:Summer-Research,代码行数:30,代码来源:2kinectsHMD.py


注:本文中的viz.addText函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。