This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
new:mouse [2018/02/15 16:33] – created korshun | new:mouse [2018/02/17 14:16] – korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Mouse cursor library ====== | ====== Mouse cursor library ====== | ||
- | The ACSUtils mouse cursor library is very easy to use: | + | ACSUtils |
< | < | ||
Line 15: | Line 15: | ||
'' | '' | ||
- | The cursor library | + | **The cursor library does not draw the cursor.** This is to give you freedom to draw it any way you want, using the coordinates provided by '' |
The cursor library fully supports widescreen thanks to ACSUtils [[Widescreeen|widescreen support functions]]. | The cursor library fully supports widescreen thanks to ACSUtils [[Widescreeen|widescreen support functions]]. | ||
+ | |||
+ | The cursor library doesn' | ||
+ | |||
+ | To check if a button is clicked on screen, check that the cursor is inside the button' | ||
<note important> | <note important> | ||
Line 25: | Line 29: | ||
===== A complete example ===== | ===== A complete example ===== | ||
- | An example using [[HudMessage]]: | + | An example using [[HudMessage]] |
< | < | ||
- | SetCursorArea(640.0, | + | // OPTIONAL: Sets cursor coordinate system |
+ | // 640x480 is already the default. | ||
+ | SetCursorArea(640.0, | ||
+ | |||
+ | // Main loop | ||
while (true) | while (true) | ||
{ | { | ||
Line 47: | Line 55: | ||
UpdateCursor(); | UpdateCursor(); | ||
| | ||
- | HudResetState(); | + | HudResetState(); |
HudSetPoint(CursorX(), | HudSetPoint(CursorX(), | ||
HudDrawImage(1, | HudDrawImage(1, | ||
Line 56: | Line 64: | ||
===== Moving the cursor ===== | ===== Moving the cursor ===== | ||
- | ==== SetCursorPosition ==== | + | * '' |
- | + | | |
- | '' | + | |
- | + | ||
- | Teleports the cursor to a new position. | + | |
- | + | ||
- | ==== CenterCursor ==== | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Teleports the cursor to the center of the screen. | + | |
===== Cursor settings ===== | ===== Cursor settings ===== | ||
Line 77: | Line 75: | ||
SetCursorSpeed(2.0); | SetCursorSpeed(2.0); | ||
EnableCursorWrap(true); | EnableCursorWrap(true); | ||
+ | |||
while (true) | while (true) | ||
{ | { |