Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 25286e750a5a43cfc0fc68e95cd65ae6 > files > 176

soya-tutorial-0.14-3mdv2010.0.i586.rpm

# -*- indent-tabs-mode: t -*-

#!/usr/bin/env python

import sys, os, PIL.Image

import soya
import soya.pudding as pudding

soya.init()
pudding.init()

scene = soya.World()
scene.atmosphere = soya.Atmosphere()
scene.atmosphere.bg_color = (1.0, 1.0, 1.0, 1.0)
camera = soya.Camera(scene)

root = pudding.core.RootWidget(width=640, height=480)

box1 = pudding.control.Box(root,
													 left=150, top=150, width=340, height=180,
													 background_color=(1.0, 0.0, 0.0, 1.0),
													 z_index=0)

box2 = pudding.control.Box(root,
													 left=100, top=100, width=200, height=280,
													 background_color=(0.0, 1.0, 0.0, 1.0),
													 z_index=-1)

box3 = pudding.control.Box(root,
													 left=340, top=100, width=200, height=280,
													 background_color=(0.0, 0.0, 1.0, 1.0),
													 z_index=1)

root.add_child(camera)
soya.set_root_widget(root)
pudding.main_loop.MainLoop(scene).main_loop()