Changes

→‎Check input: remove mouse scroll wheel value per discussion (absolute value isn't useful, mods should use event instead)
Line 22: Line 22:  
ICursorPosition cursorPos = this.Helper.Input.GetCursorPosition();
 
ICursorPosition cursorPos = this.Helper.Input.GetCursorPosition();
 
Game1.spriteBatch.DrawString(Game1.smallFont, "some text", cursorPos.ScreenPixels, Color.Black);
 
Game1.spriteBatch.DrawString(Game1.smallFont, "some text", cursorPos.ScreenPixels, Color.Black);
</source>
  −
  −
===Scroll wheel value===
  −
You can get the current mouse scroll wheel value by calling the <tt>GetMouseScrollValue()</tt> method. Note that this is the ''absolute'' scroll value; it's only meaningful when comparing to a previous scroll value. For example:
  −
  −
<source lang="c#">
  −
// detect when the player scrolls the mouse wheel.
  −
// This assumes you create a custom LastScrollValue field to keep track of the previous value.
  −
int scrollValue = this.Helper.Input.GetMouseScrollValue();
  −
int scrollChange = scrollValue - this.LastScrollValue;
  −
this.LastScrollValue = scrollValue;
   
</source>
 
</source>
  
translators
8,404

edits