[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] Question: 'Skins' support



Hi there!

This might not exactly be a pygame specific question but something tells
me, this is a good place to ask...

I'm currently reimplementing a German spelling tutoring system in
Python/pygame. In order to make customization more flexible (some
teachers working with the current system want different colors/nicer
graphics, others want very very simple graphics only etc.) I plan to
integrate some "skin" support (as known from WinAmp and many many other
programs). What I want from you out there is to tell me what you think
of my ideas how to do that:

1. Use a directory for each skin-set and a Python ConfigParser readable
file to map internal names to filenames. The thing is more complex than
just exchanging files because some graphical objects act as templates to
be filled with text etc. and I don't want to force gfx designers to use
exactely the same dimensions for their gfx, so the config file also has
to contain coordinates of rectangles to be filled. Or - that would be
much nicer - does someone know a good and fast method to automatically
produce coordinates from rectangles marked in a special color (say:
magenta) in the pictures? (Do you know what I mean? Tell the gfx
designer: Your button can have any shape, just place a nonfilled
rectangle with 1-pixel-magenta border where the programm may insert
text. The border of course will not be displayed but replaced by an
interpolation of neighbouring pixels or sth. neat like that... I'd
browse my Sedgewick for that but if anyone already implemented something
useable...)

2. Use of some sort of 'bundle-file'. The current program is implemented
in C++/Allegro and the Allegro-library
(http://talula.demon.co.uk/allegro) supports so called "datafiles" in
which you can stuff all the objects you need (gfx, sound, text, ...) and
easily retrieve them from an open DATAFILE-object in your code. Would
such a thing be a good addition to pygame? A major pro is that you can
use different implementations of datafile-classes without changing your
code: access from filesystem, from packed files, from a database, via
internet ... 

If anyone has comments, don't hesitate!

Bye,
Tobias

P.S.: If you're interested in the project and speak German, you'll find
some information on http://www.akot.de/mops.html. The new implementation
will be open source.

P.P.S.: Does anyone know of a Python interface to the
MBROLA-IPA-to-speech engine
http://tcts.fpms.ac.be/synthesis/mbrola.html)? Or would like to
cooperate on implementing such a thing? The engine is freely available
for non-commercial purposes (though without source) and there are a lot
of good diphon-sample-databases for many many languages (currently 24!).
It doesn't accept raw text but some phonemic representation and would be
a very nice thing for programs that use a lot of speech-output which has
to be customizable without resampling 'real' speech. Contact me by
personal e-mail if interested.


-- 
-------------------------------------------------------
Tobias Thelen M.A.	      tthelen@uni-osnabrueck.de
http://www.cl-ki.uni-osnabrueck.de/~nntthele/index.html
Institute of Cognitive Science, University of Osnabrück
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org