WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 02-07-2007, 09:07 AM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
viz.grab() with the mouse makes sense if the object you are grabbing is on the screen.

Code:
import viz
viz.go()


screenText = viz.addText('GrabME', viz.SCREEN)
s = 1
screenText.scale(s,s,s)
screenText.setPosition(.5, .5)

grabLink = None

def onMouseDown(button):
	global grabLink
	if grabLink:
		#in case we missed mouse up event
		grabLink.remove()
	grabLink = viz.grab( viz.Mouse, screenText )

viz.callback(viz.MOUSEDOWN_EVENT,onMouseDown)


def onMouseUp(button):
	global grabLink
	grabLink.remove()
	grabLink = None

viz.callback(viz.MOUSEUP_EVENT,onMouseUp)
__________________
Paul Elliott
WorldViz LLC
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


All times are GMT -7. The time now is 01:29 PM.


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