Cursor.lua

From Moondust Wiki
Revision as of 02:41, 17 June 2020 by Yoshi021 (talk | contribs) (starts!)
Jump to navigation Jump to search

Download: cursor.lua v1.0


Cursor.lua is a library specialized in helping you use and customize the cursor in SMBX.


Installation

local cursor = require("cursor")

Load the cursor library by placing the cursor.lua file in the level directory and loading it as shown above.


Documentation

Values

Name Type Description
x number The X position of the cursor relative to the screen
y number The Y position of the cursor relative to the screen
sceneX number The X position of the cursor relative to the scene
sceneY number The Y position of the cursor relative to the scene
speedX number The X-speed of the cursor
speedY number The Y-speed of the cursor
screenPos point collider A collider object of the cursor. The position is set to the position relative to the screen
scenePos point collider A collider object of the cursor. The position is set to the position relative to the scene
onscreen boolean
onscene boolean
camera number
left keystate The key state of the left button of the mouse. To be used just like player.keys
right keystate The key state of the right button of the mouse. To be used just like player.keys.
leftDragBox box collider A rectangle collider of the box formed when the cursor is dragged across the screen. You can also do leftDragBox.timer to check how many frames the box has been active.
leftDragBoxScene box collider A rectangle collider of the box formed when the cursor is dragged across the screen. The position is relative to the scene. You can also do leftDragBox.timer to check how many frames the box has been active.

Cursor Images


Settings

Name Description
defaultcam1
debug