![]() |
|
#1
|
|||
|
|||
|
Hello to everyone, I need to build a function that show a 3d text for one second every time that the space bar is pressed.
EX: Code:
def show():
Text=viz.addText3D('Hello world', pos,color .....)
vizact.onkeydown(' ',show)
Thanks for your help!! |
|
#2
|
|||
|
|||
|
Hi Marcello,
You can use on vizact.onkeydown(' ',show) to call a function that displays the 3D Text at every one second. request you to pls see to the artice on Timer Events and Fuctions in the documentation Steps: -start the timer on button event usign startTimer Refer Link: http://docs.worldviz.com/vizard/comm...starttimer.htm -Timer will be activated for every one second using ontimer Refer Link: http://docs.worldviz.com/vizard/comm...ct/ontimer.htm -Then last call kill timer after one seconds get over Refer Link: http://docs.worldviz.com/vizard/comm.../killtimer.htm After kill timer then again listen for button event. and folow the steps as mentioned above. Thanx&Regards Mr.Rajnish Vishwakarma Mobile,AR,VR Xenium Digital Pvt ltd,Mumbai |
|
#3
|
|||
|
|||
|
hi and thanks for your interest.
The links you have sent me are not available anymore. Anyway i know how to use the command vizact.ontimer, the problem is that i don't know how to remove the text after the first time it comes out! |
|
#4
|
|||
|
|||
|
Refer doumentation and :
Use startTimer and killTimer in co-ordination with ontimer Thanx&Regards Mr.Rajnish Vishwakarma Mobile,AR,VR Xenium Digital Pvt ltd,Mumbai Last edited by rajnishv; 08-29-2016 at 05:00 AM. |
|
#5
|
|||
|
|||
|
Removing the text is a simple call to remove if you don't need this Text instance again:
Code:
#display text
Text=viz.addText3D('Hello world', pos,color .....)
#remove text
Text.remove()
Code:
#create/display text
Text=viz.addText3D('Hello world', pos,color .....)
#toggle visibility with these
Text.visible(viz.OFF)
Text.visible(viz.ON)
|
|
#6
|
|||
|
|||
|
Hi M@rcello,
PFA the attachment of the script which i have made for you. The script shows text for every one second when a spacebar is pressed. Its a simple script. Pls go through it. Thanx&Regards Mr.Rajnish Vishwakarma Mobile,AR,VR Xenium Digital Pvt ltd,Mumbai |
|
#7
|
|||
|
|||
|
Thank you very much Rajnishv, i didn't thought to the chance to create an indipendent function to disable the visibility of the Text 'a priori'.
Well done, and many thanks |
|
#8
|
|||
|
|||
|
Thanx Marcello:
Also try to use startTimer in co ordination with the vizact.ontimer() ot vizact.ontimer2() function to create your own function.. Thanx&Regards Mr.Rajnish Vishwakarma Mobile,AR,VR Xenium Digital Pvt ltd,Mumbai |
![]() |
|
|