[wxPython] OGL background image

Hi,

I’m new to wxPython and Python, and am working on a map editor for a RTS game. I am thinking of using the object graphics library to make things easier, but I’m lost as how to use an image as the background (not tiled). I looked at the wxPython demo, but all I could see was a way to set the backround color.

Do you think OGL is the best way to go for a newbie? All I really need to do is to be able to drag around (transparent) images on a scrollable canvas, and the images should be able to have colored outlines.

Anyway, wxPython looks really cool, to someone coming from Visual Basic :slight_smile:

Thanks for any advice,

Eric

I had trouble with OGL and dropped it. The problem was that it was too high level. I wanted snap to grid to snap the top left of the shape, but it only allows moving from center, you can around most of these center of the shape probs, but not all.

Use the drag image page in the demo (with playing cards) that’s what I’m basing mine on. If you want more complexity check pySketch that comes in the samples directory.

GBU

Matthew Sherborne

I'm new to wxPython and Python, and am working on a map editor
for a RTS game. I am thinking of using the object graphics
library to make things easier, but I'm lost as how to use an
image as the background (not tiled). I looked at the wxPython
demo, but all I could see was a way to set the backround color.

Take a look at the ColourDB demo at how it handles the EVT_ERASE_BACKGROUND
event. I expect that it would work for the wxShapeCnavas window too.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!