ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


new:mouse

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
Next revisionBoth sides next revision
new:mouse [2018/02/17 03:02] korshunnew:mouse [2018/02/17 13:59] korshun
Line 19: Line 19:
 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't handle mouse button presses, as ZDoom doesn't provide access to them. To read mouse clicks, use [[zdoom>GetPlayerInput]] with ''BT_ATTACK'' (left mouse button) and ''BT_ALTATTACK'' (right mouse button). Better yet, use ACSUtils [[input|GetPlayerInput wrappers]] for simpler input handling that will not register multiple clicks if the player holds a mouse button.+The cursor library doesn't handle mouse clicks, as ZDoom doesn't provide access to mouse buttons. To read mouse clicks, use [[zdoom>GetPlayerInput]] with ''BT_ATTACK'' (left mouse button) and ''BT_ALTATTACK'' (right mouse button). Better yet, use ACSUtils [[input|GetPlayerInput wrappers]] for simpler input handling that will not register multiple clicks if the player holds a mouse button.
  
 <note important>The cursor library **cannot be used serverside**. <note important>The cursor library **cannot be used serverside**.
Line 27: Line 27:
 ===== A complete example ===== ===== A complete example =====
  
-An example using [[HudMessage]]:+An example using [[HudMessage]] (''[[rounding|floor()]]'' is used to clear alignment flags):
  
 <code> <code>
Line 62: Line 62:
 ===== Moving the cursor ===== ===== Moving the cursor =====
  
-==== SetCursorPosition ==== +  * ''void SetCursorPosition(fixed x, fixed y)'' -- Teleports the cursor to the new position. 
- +  ''void CenterCursor()'' -- Teleports the cursor to the center of the screen. 
-''void SetCursorPosition(fixed x, fixed y)'' +
- +
-Teleports the cursor to new position. +
- +
-==== CenterCursor ==== +
- +
-''void CenterCursor()'' +
- +
-Teleports the cursor to the center of the screen.  +
  
 ===== Cursor settings ===== ===== Cursor settings =====
Line 83: Line 73:
 SetCursorSpeed(2.0); // Cursor is twice more sensitive SetCursorSpeed(2.0); // Cursor is twice more sensitive
 EnableCursorWrap(true); // Teleport the cursor to the opposite end of the screen if it reaches one end EnableCursorWrap(true); // Teleport the cursor to the opposite end of the screen if it reaches one end
 +
 while (true) while (true)
 { {
new/mouse.txt · Last modified: 2018/02/19 13:04 by korshun