WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-03-2009, 08:34 AM
sl0bz sl0bz is offline
Member
 
Join Date: Jun 2008
Posts: 6
vizinfo show/hide/toggle

I have a gamepad controller. Right now, all I am trying to do is program one button on the controller that will show the info bar when the button is pressed and program a different button on the controller to hide the info bar when the button is pressed. I am able to get the info bar to show with a button press, but the vizinfo.visible(0) command will not hide the bar.

The ultimate goal is to program a single button where the info bar will only show up when the button is being held down and disappears when the button is released.

We have tried a bunch of different variations of the code, but have been unsuccessful.

Any help would be nice. Thanks in advance

Here is a cut of my code:
def InfoBar(e):
#Get the state of the buttons on joystick
state = joy.getButtonState()

#ADD Info Bar
info = vizinfo.add('Sample Text')
info.title('DEMO CONTROLS')
info.visible(0)
if state & vizjoy.BUTTON9:
info.visible(1)
if state & vizjoy.BUTTON10:
info.visible(0)
viz.callback(vizjoy.BUTTONDOWN_EVENT, InfoBar)
Reply With Quote
  #2  
Old 06-04-2009, 11:59 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You should add your vizinfo box before your function definition. The way it is there, every time you call your InfoBar function another info box is created that's only accessible within that function call.
Reply With Quote
  #3  
Old 06-04-2009, 12:41 PM
sl0bz sl0bz is offline
Member
 
Join Date: Jun 2008
Posts: 6
Thumbs up thanks

thanks for the reply!

it worked once we took the vizinfo definition out of the function definition.

bogus mistake on our part
Reply With Quote
Reply


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
Modifying Vizinfo to Support Re-parenting Tip Gladsomebeast Vizard 0 12-16-2008 06:34 PM
vizinfo + wiimote ? djdesmangles Vizard 6 10-22-2008 03:18 PM
"Vizard Lite" graphic obscuring vizinfo pups halley Vizard 0 05-30-2006 11:07 AM
vizinfo in HMD mode enkeli Vizard 8 03-01-2006 04:47 PM
vizinfo vadrian Vizard 1 11-05-2004 03:40 PM


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


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