WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-29-2016, 03:07 AM
M@rcello M@rcello is offline
Member
 
Join Date: May 2016
Posts: 11
Red face temporary 3DText

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)
The 'Hello world' has to disappear after one second.

Thanks for your help!!
Reply With Quote
  #2  
Old 08-29-2016, 04:39 AM
rajnishv rajnishv is offline
Member
 
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
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
Reply With Quote
  #3  
Old 08-29-2016, 04:50 AM
M@rcello M@rcello is offline
Member
 
Join Date: May 2016
Posts: 11
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!
Reply With Quote
  #4  
Old 08-29-2016, 04:55 AM
rajnishv rajnishv is offline
Member
 
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
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.
Reply With Quote
  #5  
Old 08-29-2016, 05:10 AM
istarion istarion is offline
Member
 
Join Date: Aug 2016
Posts: 13
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()
If you want to hide/show the same text multiple times us this:
Code:
#create/display text
Text=viz.addText3D('Hello world', pos,color .....)

#toggle visibility with these
Text.visible(viz.OFF)
Text.visible(viz.ON)
Reply With Quote
  #6  
Old 08-30-2016, 05:59 AM
rajnishv rajnishv is offline
Member
 
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
Smile Reply for ' temporary 3DText'

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
Attached Files
File Type: zip changeTextTimer.zip (440 Bytes, 634 views)
Reply With Quote
  #7  
Old 08-31-2016, 12:46 AM
M@rcello M@rcello is offline
Member
 
Join Date: May 2016
Posts: 11
Talking

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
Reply With Quote
  #8  
Old 09-03-2016, 12:54 AM
rajnishv rajnishv is offline
Member
 
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
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
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


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


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