Direct3DDevice8.SetCursorProperties
Sets properties for the cursor.
object.SetCursorProperties( _
XHotSpot As Long, _
YHotSpot As Long, _
CursorSurface As Direct3DSurface8)
Parts
- object
- Object expression that resolves to a Direct3DDevice8 object.
- XHotSpot
- X-coordinate offset into the cursor, in pixels from the top-left corner, that is considered the center. When the cursor is given a new position, the image is drawn at an offset from this new position determined by subtracting the hot spot coordinates from the position.
- YHotSpot
- Y-coordinate offset into the cursor, in pixels from the top-left corner, that is considered the center. When the cursor is given a new position, the image is drawn at an offset from this new position determined by subtracting the hot spot coordinates from the position.
- CursorSurface
- A Direct3DSurface8 object. This parameter must point to an 8888 ARGB surface (format D3DFORMAT_A8R8G8B8). The contents of this surface will be copied and potentially format-converted into an internal buffer from which the cursor is displayed. The dimensions of this surface must be less than the dimensions of the display mode, and must be a power of two in each direction, although not necessarily the same power of two. The alpha channel must be either 0.0 or 1.0.
Error Codes
If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
Remarks
This method is independent of the Microsoft® Win32® API ShowCursor and SetCursor functions. Applications should either use the Win32 cursor or the Microsoft Direct3D® cursor, not both.
The application can determine what hardware support is available for cursors by examining appropriate members of the D3DCAPS8 type. Typically, hardware supports only 32x32 cursors. Additionally, when windowed, the system might support only 32x32 cursors. In this case, SetCursorProperties still succeeds, but the cursor may be reduced to that size—the hot spot is scaled appropriately.
See Also
Direct3DDevice8.SetCursorPosition, Direct3DDevice8.ShowCursor , D3DCAPS8