[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Layout module for Pygame surfaces
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Layout module for Pygame surfaces
- From: Pablo Recio Quijano <rikutheronin@xxxxxxxxx>
- Date: Thu, 13 May 2010 11:04:31 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 13 May 2010 05:18:17 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=zmuHUrVNdTcjrUTX1qInMfovE71jloNJjIWavhvB7Ew=; b=DlS2S46cRptEZGdFhQZzNijQPZvY8wT7cjlst3YiH0EENvB2DmLM0TY/UPlzTCxskU S5GemqHr4XSC0SeSzafiTh9sZGr4KonsRLbzoCwfGZ/DfdQbzYh8FyQDav0OZp34WtWZ WYZtvUZfwx6LwFFGTprOoepm3RVcs8PLIx04U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=X1nlhJJKOENs64s/dkm8BSAvQGI8qQt0ENsMprTZC1TefhUj69w5LdFv6jQu2O2j7r lDOM+jvlUb0JiTq2UzR7yUV1hbtmMxIJil1lBLTx+UE9aeG06w/MsaYVOAgXN0K/WvLz 4dSDzP0mAhpZGHu7+cvSiinZx1+1pDH32pZco=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi!
Some months ago I developed an application that uses Pygame as main media lbrary. One of the problems I saw when I was developing is to structure the layout of the screen, because sometimes you want to make some layout to organize on a best way that screen.
Here is some example: http://sumergiendose.files.wordpress.com/2009/12/layout.png
You have a board, a frame with buttons, other with the names... The position of those elements use to be on code, so it's hard to has some representations. So I develop a module that store and manage that information on a XML file. This way, is possible to has a lot of representations without touching the code. An example of this XML could be:
<label name="exit_button" type="button">
<propierty name="exit_button_size" type="size">
<value id="weight">50</value>
<value id="height">50</value>
</propierty>
<propierty name="exit_button_position" type="position">
<value id="x">650</value>
<value id="y">500</value>
</propierty>
<propierty name="exit_button_images" type="button_images">
<value id="default">./images/salir.png</value>
<value id="above">./images/salir_sobre.png</value>
<value id="pressed">./images/salir_pulsada.png</value>
</propierty>
</label>
Is possible to group elements of this kind on a father element, to abstract them of the position of the screen. The module provides functions to update the environment in some kind signals, draw all the surface with a single function and more.
I want to know if his project could be useful at a general level, to make a library with this feature and share with the community.
Thanks!
--
Pablo Recio Quijano
Estudiante de Ingeniería Informática (UCA)
Alumno colaborador del Departamento de Lenguajes y Sistemas Informáticos