/usr/share/doc/python-soya-doc/examples/pudding-image-slicing-1.py is in python-soya-doc 0.14-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- indent-tabs-mode: t -*-
import sys, os, PIL.Image
import soya
import soya.pudding as pudding
import soya.pudding.ext.slicingimage
soya.init()
soya.path.append(os.path.join(os.path.dirname(sys.argv[0]), "data"))
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)
w = pudding.core.RootWidget(width = 640,height = 480)
# note that the image dimensions are 312 x 132!
pil_logo = PIL.Image.open(os.path.join(os.path.dirname(__file__),
'data/images/oomad.png'))
logo = pudding.ext.slicingimage.SlicingImage(w, pil_logo, left=100, top=100)
w.add_child(camera)
soya.set_root_widget(w)
pudding.main_loop.MainLoop(scene).main_loop()
|