View Single Post
  #8  
Old 01-14-2009, 08:38 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
I run into a similar problem when creating GUIs. Some child nodes don't take the alpha of their parent. In the following example the texture quad does inherit the parent's alpha, the text and on-the-fly objects do not.

By the by, I only got the texture quad to take the parent's alpha when I set the alpha call's op mode to viz.OP_OVERRIDE.

Code:
import viz
viz.go()
viz.clearcolor(viz.SKYBLUE)
forceIDRoot = viz.addGroup(parent=viz.SCREEN, pos=[.40, .92, 0])
forceIDRoot.alpha(.5, op=viz.OP_OVERRIDE) # viz.OP_OVERRIDE gets the quad alphaed
forceIDQuad = viz.addTexQuad(parent=forceIDRoot, scale=[4.5,1,0]) #yes alpha
#no text alpha
t = viz.addText('afdasdf asdfasdf', parent=forceIDRoot, pos=[-.165, .01, 0], scale=[.3]*3)
t.color(viz.BLACK)

viz.startlayer(viz.QUADS)
viz.vertex([0,0,0])
viz.vertex([.5,0,0])
viz.vertex([.5,.5,0])
viz.vertex([0,.5,0])
viz.endlayer(parent=forceIDRoot) #no alpha?
__________________
Paul Elliott
WorldViz LLC
Reply With Quote