ImageMouseCursor Class

Inheritance diagram of ImageMouseCursor

class ImageMouseCursor(image, hot_x=0, hot_y=0)

A user-defined mouse cursor created from an image.

Use this class to create your own mouse cursors and assign them to windows. There are no constraints on the image size or format.

Constructor:

__init__(image, hot_x=0, hot_y=0)

Create a mouse cursor from an image.

Parameters:
  • image (pyglet.image.AbstractImage) – Image to use for the mouse cursor. It must have a valid texture attribute.
  • hot_x (int) – X coordinate of the “hot” spot in the image relative to the image’s anchor.
  • hot_y (int) – Y coordinate of the “hot” spot in the image, relative to the image’s anchor.

Methods:

draw(x, y)

Attributes:

drawable Type: bool

Methods

ImageMouseCursor.draw(x, y)

Attributes

ImageMouseCursor.drawable = True

Table Of Contents

Previous topic

FPSDisplay Class

Next topic

MouseCursor Class