Add mouse_movement usage example#761
Conversation
❌ Deploy Preview for splashkit failed.
|
RUNQILIU-123
left a comment
There was a problem hiding this comment.
Approved.
I reviewed the added mouse_movement usage example files across C++, C# top-level, C# OOP, and Python. The examples are clear, beginner-friendly, and demonstrate the target SplashKit function well by showing how mouse movement values update after process_events() and how those values can be used to move an object on screen.
The file naming and structure are consistent with the existing usage example format, and the example focuses on the required function without adding unnecessary complexity. Overall, this is a suitable usage example for the Input category.
Good work.
himanshigaba22
left a comment
There was a problem hiding this comment.
Nice example - it’s clear, simple, and easy to follow. It demonstrates mouse_movement() really well.
Just one small thing - in the Python version, draw_text_no_font_no_size() is used instead of draw_text(). Just wanted to check if that was intentional, since most examples use draw_text().
Otherwise, everything looks good 👍
Description
Splashkit Function:
mouse_movementOverview of example functionality:
This pull request adds a beginner-friendly usage example for the
mouse_movementfunction in the Input category.The example opens a graphical window and displays the current mouse movement values in real time. It demonstrates how
mouse_movement()returns the amount of mouse movement since the lastprocess_events()call.The program uses the movement vector to move a blue circle around the window. It also displays the X and Y movement values on screen and draws a red line to show the latest movement direction. This helps beginners understand the difference between mouse position and mouse movement.
Files Included
Usage Example Checks
How Has This Been Tested?
The example was tested locally to confirm that:
mouse_movement()values update when the mouse movesI also checked existing pull requests and repository files before starting this task. I did not find an existing standard
mouse_movement-1-examplefile set underpublic/usage-examples/input/. Although mouse movement is mentioned in older mouse input tutorial material, this PR adds a dedicated standard usage example for themouse_movementfunction.Testing Checklist
Folders and Files Added/Modified
Added:
public/usage-examples/input/mouse_movement-1-example.cpppublic/usage-examples/input/mouse_movement-1-example-top-level.cspublic/usage-examples/input/mouse_movement-1-example-oop.cspublic/usage-examples/input/mouse_movement-1-example.pypublic/usage-examples/input/mouse_movement-1-example.txtpublic/usage-examples/input/mouse_movement-1-example.pngModified:
scripts/json-files/usage-example-references.jsonAdditional Notes
This example is designed to be simple and beginner-friendly. It focuses on demonstrating how
mouse_movement()works afterprocess_events()without adding unnecessary complexity.