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 revisionPrevious revision
Next revision
Previous revision
en:tutorials:display:custom_mouse_cursor [2018/08/28 04:00 (6 years ago)] sausageen:tutorials:display:custom_mouse_cursor [2021/06/26 06:26 (3 years ago)] (current) sausage
Line 1: Line 1:
 ====== Custom Mouse Cursors ====== ====== Custom Mouse Cursors ======
  
-<WRAP center round info 90%> +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''.
-This feature will be released in September 2018. +
-</WRAP> +
- +
-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|default''+
  
 <code> <code>
Line 12: Line 8:
 </code> </code>
  
-{{ :en:tutorials:display:hand-cursor.png |}}+{{ 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:display:amiga-cursor.png | }}
  
 <code ini> <code ini>
Line 23: 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>
  
-{{ :en:tutorials:display:custom-cursor-outside.png |}}+{{ tutorials:display:custom-cursor-outside.png |}}
  
 And like a normal cursor, it will hang outside the bounds of the window when you are the right or bottom extremes. Very nice. And like a normal cursor, it will hang outside the bounds of the window when you are the right or bottom extremes. Very nice.
  
-You can change cursors using the [[en:tutorials:guide_to_the_orx_console|Orx Console]]. Press the ~ key to open the console and type:+You can change cursors using the [[en:tutorials:config:guide_to_the_orx_console|Orx Console]]. Press the ~ key to open the console and type:
  
     Mouse.SetCursor crosshair     Mouse.SetCursor crosshair
  
-{{ :en:tutorials:display:cursor-orx-console.png |}}+{{ tutorials:display:cursor-orx-console.png |}}
  
 Finally, you can set a mouse cursor in code: Finally, you can set a mouse cursor in code:
  
 <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 53: Line 49:
 hotspot.fY = 10; hotspot.fY = 10;
   
-orxMouse_SetCursor("hresize", &hotspot);+orxMouse_SetCursor("amiga-cursor.png", &hotspot);
 </code> </code>
  
 +===== Hiding the mouse cursor ===== 
 +If you don't want a cursor to display at all then you won't want to show it. You an use the ''ShowCursor'' in the ''Mouse'' section. See [[en:orx:config:settings_main:main#mouse_module|Mouse Config inputs]] for more details.
en/tutorials/display/custom_mouse_cursor.1535454040.txt.gz · Last modified: 2018/08/28 07:00 (6 years ago) (external edit)