Entire Class Index | Main Class Index | Cross Index | Global Index

# Class CL_MouseCursorProvider

Mouse cursor image interface.
Contained in: global
Derived from: none
Derived by: none
Group: Display (Display 2D)

#include <ClanLib/display.h>

### public function member index:

### Construction:

``static` `CL_MouseCursorProvider`*` | `create` | `(`CL_SurfaceProvider`* `provider`, `bool` `delete_provider`=true, `bool` `animate`=true, `const` `std::vector`<`int`>* `frame_delays`=NULL)`;
``static` `CL_MouseCursorProvider`*` | `load` | `(`const` `std::string`& `resource_id`, `CL_ResourceManager`* `manager`)`;
``virtual`` | `~CL_MouseCursorProvider` | `()`;

### Attributes:

``virtual` `CL_SurfaceProvider`*` | `get_surface_provider` | `()`;
``virtual` `bool`` | `is_animated` | `()`;
``virtual` `int`` | `get_frame_delay` | `(`unsigned` `int` `frame_number`)`;

## Description:

The mouse cursor provider is an interface that describes how a mouse cursor should animate, and which images it should use.
Use this class to create your cursor icon, and then use CL_MouseCursor to make your cursor visible.

## Function Member Descriptions:

CL_MouseCursorProvider::create - Creates a mouse cursor source, using a surface provider as the image source.
If the surface provider contain subframes, those will be available in the mouse cursor too. Furthermore, those frames can be used to animate the cursor, if a list of millisec delays are passed as well.
``static` `CL_MouseCursorProvider`*` `create` `(`CL_SurfaceProvider`* `provider`, `bool` `delete_provider`=true, `bool` `animate`=true, `const` `std::vector`<`int`>* `frame_delays`=NULL)`;

> provider - Image of the cursor.
> delete_provider - If true, the surface provider will be
> deleted together with the cursor provider.
> animate - If true, the subframes in the surface provider will
> be used to animate the cursor.
> frame_delays - A list of millis to wait between each frame,
> when animating the cursor.

CL_MouseCursorProvider::get_frame_delay - Returns the millisec delay between 'frame_number' and the next one.
``virtual` `int`` `get_frame_delay` `(`unsigned` `int` `frame_number`)`;

CL_MouseCursorProvider::get_surface_provider - Returns the surface provider associated with the mouse cursor.
``virtual` `CL_SurfaceProvider`*` `get_surface_provider` `()`;

CL_MouseCursorProvider::is_animated - Returns true if the cursor is animated.
``virtual` `bool`` `is_animated` `()`;

CL_MouseCursorProvider::load - Creates a mouse provider, loaded from resources.
``static` `CL_MouseCursorProvider`*` `load` `(`const` `std::string`& `resource_id`, `CL_ResourceManager`* `manager`)`;

> resource_id - Resource ID of the mouse cursor.
> manager - Resource manager where the cursor is loaded from.

CL_MouseCursorProvider::~CL_MouseCursorProvider - Mouse Cursor Provider destructor
``virtual`` `~CL_MouseCursorProvider` `()`;