PDA

View Full Version : Title Screen


c4am95
03-29-2010, 01:31 PM
For some reason I've had some trouble doing something that should be fairly easy. Before rendering the world, I want a really simple title screen to pop up, eg a colored screen with some text. When the user is ready, eg some key is pressed, that screen disappears and the world begins rendering. I'm new to vizard (and haven't done a ton of graphics), so I don't know what the best way to do this is. So...let's talk about it huh? Please?

Jeff
03-29-2010, 02:59 PM
If you want a simple title screen you can set the background color and add some text to the screen. When the user hits a key you can remove the text and render the world.
import viz
viz.go()

gallery = viz.add('gallery.ive')
gallery.visible(viz.OFF)

viz.clearcolor(viz.SKYBLUE)
text = viz.addText('Title Screen', parent = viz.SCREEN)
text.setPosition(0.3,0.5)

def showWorld():

gallery.visible(viz.ON)
text.remove()
viz.clearcolor(viz.BLACK)

vizact.onkeydown(' ',showWorld)

If you wanted to show an image for the title sceen the following knowledge base article describes how to replace the background color with an image.

http://kb.worldviz.com/articles/813

c4am95
03-30-2010, 12:05 PM
thanks for your reply. i'm assuming that "gallery" is an environment model or something right? so basically this code would set the visibility of everything in the world off initially, and upon user input turn the visibility of those objects back on? so you would have to do this for every single world object? if so, i was kind of looking for a solution that avoided that. i just thought perhaps there was a way to disable all world rendering that didn't disable 2d text rendering. if not, though, this method isn't tough.

farshizzo
03-30-2010, 12:30 PM
If you want to hide the entire scene then you can use the following code:viz.MainScene.visible(0,viz.WORLD) #Hide all objects in world
.
.
.
viz.MainScene.visible(1,viz.WORLD) #Unhide all objects in world

c4am95
04-08-2010, 01:24 PM
thanks for your help. that'll work. i didn't know about multiple scenes so now i understand much better.