Richard Jones' Log: pyglet update
Over Christmas and the New Year I've finally had some chances to get my hands dirty and contribute some more pyglet code (beyond the meagre xlib code I added many moons ago). I've been working on the 2D scene code:
- rendering of rect and hex maps to a viewport (usually whole window)
- loading a tileset and map from an XML spec
- running a simple simulator driving a sprite around that map
Points of interest:
- you can have many maps of differing dimensions and offsets in layers
- views may be anchored, allowed to scroll and asked to stick to map boundaries
- map cells may have a tile (image) and/or properties (or nothing)
- map / tileset loading is done through a new generic resource loader which is easily extensible
Still to do:
- events for sprites / tiles -- mouse enter/leave, button press, mouse drag (this has been designed and partially implemented)
- sprite collision
- resource saving
Alex has been incredibly productive working on the layout code (which now has funky event generation), but I'll let him describe that work. It's so cool.
I hope to start the "intro to pyglet" tutorial soon...