On 10/15/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello, > > I am wondering what I should do if I want to construct an image > programatically from a set of other images. What I'm trying to do is > create an image of a spaceship, given a series of images for each part > (like an engine, cockpit, fuselage) that can be translated, rotated, > scaled, etc. such that you could make a large number of different- > looking ships with code. > > I think I am on the right track, creating a sprite for each part, > performing the various transformations, and then extracting the image > data with "sprite.image.get_image_data()". For now, I am also loading > a blank image with full transparency on every pixel and scaling it to > the size that I need, in order to fit the part images. However, I > cannot successfully use 'blit_into' like so: > > full_img.blit_into(part_sprite.image.get_image_data(), x, y, 0) > > I end up getting this error: > > File "C:\devel\pyglet\image\__init__.py", line 1598, in > blit_into > source.blit_to_texture(self.target, self.level, x, y, z) > File "C:\devel\pyglet\image\__init__.py", line 948, in b > lit_to_texture > data) > File "C:\devel\pyglet\gl\lib.py", line 105, in errcheck > raise GLException(msg) > pyglet.gl.lib.GLException: invalid value > > I honestly don't know what's going on there, even after looking at the > code in question. I'm betting someone has done something like this > before, what am I doing wrong?
Make sure that the source image fits completely within the bounds of the destination image at the blit location you've requested. Note that the anchor_x and anchor_y properties affect the blit location (if you don't know what these are, they don't apply to you). Failing that, I suggest posting a complete code example, including the images used, so that other members of the list can reproduce the problem and offer suggestions. Alex. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
