User Tools

Site Tools


en:tutorials:display:custom_mouse_cursor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:tutorials:display:custom_mouse_cursor [2018/09/10 13:26 (2 months ago)]
iarwain
en:tutorials:display:custom_mouse_cursor [2018/09/10 13:35 (2 months ago)] (current)
iarwain Minor fixes
Line 1: Line 1:
 ====== Custom Mouse Cursors ====== ====== Custom Mouse Cursors ======
  
-The ''​Cursor''​ property allows you set the type of mouse cursor image that is used when over the active window, or game. There are several standard ones built-in provided by the OS:​ ''​arrow'',​ ''​ibeam'',​ ''​crosshair'',​ ''​hand'',​ ''​hresize'',​ ''​vresize''​ and ''​default''​.+The ''​Cursor''​ property allows you set the type of hardware ​mouse cursor image that is used when over the active window, or game. There are several standard ones built-in provided by the OS:​ ''​arrow'',​ ''​ibeam'',​ ''​crosshair'',​ ''​hand'',​ ''​hresize'',​ ''​vresize''​ and ''​default''​.
  
 <​code>​ <​code>​
Line 10: Line 10:
 {{ :​en:​tutorials:​display:​hand-cursor.png |}} {{ :​en:​tutorials:​display:​hand-cursor.png |}}
  
-Alternatively,​ a very nifty feature is to provide your own png image as the cursor. Great for games where a fancy cursor is needed, ie:+Alternatively,​ a very nifty feature is to provide your own image as the cursor ​(''​png'',​ ''​jpg'',​ ''​bmp'',​ ''​tga''​ or ''​webp''​ are all supported). Great for games where a fancy cursor is needed, ie:
  
 {{ :​tutorials:​amiga-cursor.png | }} {{ :​tutorials:​amiga-cursor.png | }}
Line 19: Line 19:
 </​code>​ </​code>​
  
-By default, this will place the cursor in the top left hand corner. You can move this hotspot by providing an optional vector, ie:+By default, this will place the cursor's hotspot ​in the top left corner. You can move this hotspot by providing an optional vector, ie:
  
 <code ini> <code ini>
 [Display] [Display]
-cursor = amiga-cursor.png # (10, 10, 0)+cursor = amiga-cursor.png # (10, 10)
 </​code>​ </​code>​
  
Line 39: Line 39:
  
 <code c> <code c>
-orxMouse_SetCursor("​hresize", orxNULL);+orxMouse_SetCursor("​amiga-cursor.png", orxNULL);
 </​code>​ </​code>​
  
-This will set the cursor to a hand, and keep the default hotspot by using orxNULL. Change the hotspot position using a vector like:+This will set the cursor to the amiga arrow, and keep the default hotspot by using orxNULL. Change the hotspot position using a vector like:
  
 <code c>  <code c>
Line 49: Line 49:
 hotspot.fY = 10; hotspot.fY = 10;
   
-orxMouse_SetCursor("​hresize", &​hotspot);​+orxMouse_SetCursor("​amiga-cursor.png", &​hotspot);​
 </​code>​ </​code>​
- 
  
en/tutorials/display/custom_mouse_cursor.txt · Last modified: 2018/09/10 13:35 (2 months ago) by iarwain