WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 04-08-2016, 07:44 AM
jelly jelly is offline
Join Date: Feb 2016
Posts: 38
Smile help with triggering an action


I have a small problem because I don't know how to combine two actions.

I have a small texquad on the upper left corner of the screen and a list fo 4 pictures, that will be shown one after the other as textures to the quad. I want my trial function to go though all 4 pictures in the list. A left mouse button click shoul trigger the next picture. However, I want this to happen, only when the left mouse button is clicked AND when it is placed over the textquad (basically selecting the picture), but not when the lft mouse button is clicked anywhere else on the screen. Do you have any pointers that would get me in the right direction?

(I am a beginner with programming, I am not asking for debugging, this is just to see whether my rationale is completely off or whether I am already on the right track)

Here is what I have so far:



import viz 													
import vizshape												
import viztask												
import vizinput												
import time													
import random												
import linecache												
import vizact												
import itertools


#Start Vizard														



#Set background colour

#Make a screen window:
screen1 = viz.addTexQuad(size=0.5)            
screen1.setSize([0.2, 0.2])

myList = ['sil1.png', 'sil2.png', 'sil3.png', 'sil4.png']
myListIndex = 0

def click():
	object = viz.pick()
	if object == screen1:
		print 'picture'
		vizact.onmousedown(viz.MOUSEBUTTON_LEFT, click)

def trial():
	global myListIndex
	for x in range(4):
		picture = viz.add(myList[myListIndex])
		vizact.onmousedown(viz.MOUSEBUTTON_LEFT, click)
		yield viztask.waitTime(3)
		myListIndex = myListIndex + 1


Thank you very much in advance for the help!

Reply With Quote

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
Walking action of avatars SivaKartheek Vizard 3 01-08-2016 09:17 AM
Walking action of avatars(files are attached) SivaKartheek Vizard 1 12-15-2015 06:36 AM
walking action of avatars SivaKartheek Vizard 1 12-14-2015 10:58 PM
vizact move action andreionutz Vizard 13 11-19-2014 02:54 AM
adding more than 1 action for avatar animation slider control yak Vizard 0 07-21-2009 11:22 AM

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

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