Sharedwww / talks / 2006-05-09-sage-digipen / tutorial / pudding-svgelements-1.pyOpen in CoCalc
Author: William A. Stein
1
#!/usr/bin/env python
2
3
import os, sys
4
5
import soya.pudding as pudding
6
import soya.pudding.ext.svgelements as svgelements
7
8
import soya
9
10
soya.init()
11
soya.path.append(os.path.join(os.path.dirname(sys.argv[0]), "data"))
12
13
e_man = svgelements.ElementManager('test.png', 'test.svg')
14
e_man.find_elements()
15
print e_man.elements
16
17
scene = soya.World()
18
camera = soya.Camera(scene)
19
20
soya.set_root_widget(pudding.core.RootWidget())
21
soya.root_widget.add_child(camera)
22
23
elimg = svgelements.ElementImage(soya.root_widget,
24
left=0, top=0, width=0, height=0,
25
manager=e_man, image='console')
26
elimg.on_resize()
27
28
svgelements.ElementImage(soya.root_widget,
29
left=0, top=elimg.height, width=0, height=0,
30
manager=e_man, image='info')
31
32
pudding.idler.Idler(scene).idle()
33
34
35