Showing posts with label pyglons. Show all posts
Showing posts with label pyglons. Show all posts

17/04/2008

pyglons 0.3 release

I've just posted an egg and .tar.gz of pyglons 0.3 on the pyglons project site.

0.3 uses a new templating system as I posted about before. I've also done some major work on the front page of the site to try and explain a little better about what the thing actually does. I'm planning on announcing this to the pyglet group soon ...

pyglons 0.3 on its way

I just commited the new templating code for pyglons based on what pylons is now doing using the latest PasteScript and tempita modules. This adds the possibility to pass options on the command line when creating your project to better describe what you do and dont want.

For example its now possible to do:

$ paster create -t pyglons my_project_name configobj=true

This will create a new project with the required code to load your config via ConfigObj. Disabling this means your project will use nothing but a simple dictionary for its initial config.

Actually you could always set options on the command line but only now do they include/exclude code from the pyglons templates. If you dont specify the option on the command line you will still get prompted for it ( unless your using --no-interactive ).

There will be more options in the future for adding code for pymunk, windoh etc in future versions of pyglons but this is essentially it for the 0.3 version I think. Ill post new downloads later today.

13/04/2008

windoh

Another day another project... >_< well i got to thinking i'd really to have something like Ant Tweak Bar but pure python which led on to thinking of a quick and simple UI library for pyglet... which led onto a not so simple UI library for pyglet... :)

windoh uses pyglets event.EventDispatcher class heavily to make a reasonably nice widget system. It includes a resizeable/draggable frame class and fully inheritable style support. There is also a button and a label class at the moment, I expect there will be more as time goes on.

I need to work out whats going on with pyglets batches a bit better but otherwise it all seems to work pretty ok.

Ive also checked how pylons is doing the --with- stuff so ill be adding pymunk, windoh and maybe atb-ctypes to --with- options to pyglons soon.

The source is in the pyglons repository and there is a very basic page at the pyglons wiki.

True to form there is absolutely zero documentation at the moment, you can check the test.py file, other wise may the source be with you...

12/04/2008

11/04/2008

Ant Tweak Bar ctypes module

For every 3d project iv made with python ive always written a way to use Ant Tweak Bar so I thought for historical reasons I should again for use with pyglet ( and pyglons ). So..

atb-ctypes is a ctypes wrapper around Ant Tweak Bar. It includes a pyglet event handler that can easily be pushed onto the event stack. It is of course perfectly possible to use atb-ctypes with any other windowing/event library, it does not depend on pyglet.

A very minimal sample:

import pyglet
from pyglet.gl import *

import atb
from atb.pyglet_handler import ATBEventHandler

window = pyglet.window.Window()

@window.event
def on_close():
    pyglet.app.exit()

atbhandler = ATBEventHandler(window)

if __name__ == '__main__':
    atb.init()

    for x in range(2):
        bar = atb.Bar('my bar %d' % x)
        myVar = c_float()
        COLOR4F = c_float * 4
        myColor = COLOR4F()
        bar.add_var("some float", myVar)
        bar.add_var("some color", myColor)

    def say_hello(*args):
        print args, "hello"

    bar = atb.Bar('buttons')
    bar.add_button("my button", say_hello)

    pyglet.app.run()

The code is in the pyglons googlecode repo now.

Now I have to go socialize... Its friday!! :]

10/04/2008

pyglons_minimal

pyglons now provides a second paster template: 'pyglons_minimal'. This does away with the states directory and puts just one state in main.py for you to start with. The template is aimed at people who know their way around pyglons and want to do things "their way" or just for very quick test scripts where the developer is used to how pyglons works ;)

Im about to try clutter now inside pyglet as a possible pyglons "recommended" UI library...

09/04/2008

pyglons in pyglons in pyglons in...

pyglons application class now also subclasses from the state class... what does this mean? With a few more tweaks to the base application, applications can now run inside other applications ( inside other applications ( inside other applications (... enough!

Why? Well its kind of cool for one! Two: it allows you to write loaders for other games ( with a little entry point magic you could create nice loaders for your other apps ). And three, because thats what you can do with pylons and wsgi in general!

Im thinking it could also be used for generic settings screens or something.. somehow..

pyglet application entry point specification anyone...?

07/04/2008

pyglons and pymunk brick game

In the pyglons repository is now a complete brick game based on pyglons! It uses pymunk (using chipmunk) for physics. The game features splash screens, menu, and fully working game with lives, scoring, paused state, etc etc ... everything a "real" game has :) The only change from the templates pyglons created has been the game state class so far ( as it should be! ) altho I think a little customisation might be on the way...

I think Ive got a few ideas to improve pyglons a bit now...

06/04/2008

more pyglons

pyglons development has been going full steam ahead and now includes config file support ( including loading logging config ), much nicer event handling in the base state, the possibility to play videos in the splash screen and, as they say, much much more :)

Actually pyglons should hopefully be finished now except for bugs so I can go back to what I was making in the first place..

05/04/2008

pyglons!

I had a crazy idea yesterday evening and Ive just finished the first version. pyglons takes ideas from pylons and utilises pastes paster command to make creating pyglet games a snap.

At the moment pyglons will generate you a small working application with splash screen, menu, help and vary basic game state skeleton ready for you to add your code. I plan to use the pylons idea of not forcing the developers to use anything they dont want to whilst still maintaining some sane defaults

Example and code can be got from http://code.google.com/p/pyglons/