Yaaay, thanks for help ! With Your event it got to draw for me too :).
Yeah, I didnt see anything about it in documentation and I couldnt figure
out why it didnt work :<.

2018-05-07 15:43 GMT+02:00 Benjamin Moran <[email protected]>:

> Hi Mateusz,
>
> I've never used a custom mouse cursor myself, but for some reason adding
> a dummy on_mouse_motion event got it to draw for me:
>
> @window.event
> def on_mouse_motion(*args):
>     pass
>
>
> I'm not sure of the intended behavior, but maybe the documentation needs
> to be updated to explain the usage.
> It's also possible that this is a bug, but I can't say without looking
> through the code.
>
> -Ben
>
>
>
> On Sunday, May 6, 2018 at 9:29:49 PM UTC+9, Mateusz Materzok wrote:
>>
>> Hello, I started to learn Pyglet yeasterday. I'm trying to draw custom
>> mouse icon and for some reason program draw nothing.
>>
>> Here is a code:
>>
>> import pyglet
>>
>>
>> def create_window(width, height):
>>     return pyglet.window.Window(width=width,
>>                                 height=height,
>>                                 caption="Pyglet library")
>>
>>
>> def load_cursor(filename):
>>     image = pyglet.image.load(filename)
>>     return pyglet.window.ImageMouseCursor(image, 16, 16)
>>
>>
>> window = create_window(640, 480)
>> cursor = load_cursor("Example.png")
>> window.set_mouse_cursor(cursor)
>>
>>
>> @window.event
>> def on_draw():
>>     window.clear()
>>
>>
>> pyglet.app.run()
>>
>>
>>
>> Anyone have clue why program show nothing as mouse cursor ?
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/pyglet-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to