El 18/08/2008, a las 1:09, Alex Holkner escribió:
> On 8/18/08, Grzegorz Adam Hankiewicz <[EMAIL PROTECTED]>  
> wrote:
>> [...] However, I'm not seeing anywhere a stretch method or
>> something like that which I could use to make the image fit into the
>> window.
>
> If you're using blit(), you can pass in width and height keyword  
> parameters:
>
> http://pyglet.org/doc/api/pyglet.image.Texture-class.html#blit
>
> If you're using sprites, use the scale property:
>
> http://pyglet.org/doc/api/pyglet.sprite.Sprite-class.html#scale

I'm still trying to figure out how to find information in those mazes  
of little one liners each appended to individual methods overriden by  
deep classes' hierarchies.

In hope of improving the situation a bit, please accept the attached  
example to help future users. 
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Attachment: stretch_example.diff
Description: Binary data


While I'm at it, if I put a print statement inside the window's  
on_draw() method, I notice it gets called even when the user moves the  
mouse over the window (I'm running under macosx).

This seems like a waste of CPU/GPU, and I thought at least under  
macosx quartz (or whatever the thing that draws stuff is) everything  
was double buffered, which would remove the need to redraw the  
window's screen with mouse movements.

Is this wrong or haven't I reached yet to the "use double buffer in  
your pyglet code" part? After all, the cursor seems to be drawn by the  
os, and if macosx composes all windows beautifully with tricks like  
expose without the apps noticing it, I don't understand why the  
example would even need to redraw the screen for mouse position changes.

Reply via email to