Skip to content

Add mouse_position usage example#710

Open
Osaid2993 wants to merge 2 commits intothoth-tech:mainfrom
Osaid2993:mouse-position-usage-example
Open

Add mouse_position usage example#710
Osaid2993 wants to merge 2 commits intothoth-tech:mainfrom
Osaid2993:mouse-position-usage-example

Conversation

@Osaid2993
Copy link
Copy Markdown

Description

Splashkit Function: mouse_position

Overview of example functionality: This example opens a graphical window and displays the current mouse position in real time. It demonstrates how mouse_position can be used to track the mouse cursor by showing the X and Y coordinates on screen and drawing a small circle that follows the mouse inside the window.

Example Output:
mouse_position-1-example

Files Included

  • C++ code
  • C# code (Top-Level statements)
  • C# code (Object-Oriented Programming)
  • Python code
  • Relevant title for the example (.txt)
  • Screenshot

Usage Example Checks (READ CAREFULLY)

  • Code uses Splashkit function above
  • Code does not use non-Splashkit functions
  • Code does not use extra function declarations or extra classes
  • Code does not violate any of the Thoth Tech SplashKit Style Guide rules
  • Simple, clear demonstration of the function
  • Tested in Chrome and Firefox

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for splashkit failed.

Name Link
🔨 Latest commit 8633d30
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/69cba67e923b1f00083cefb7

Copy link
Copy Markdown

@kottochii kottochii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peer review

The examples are shown on the respective page as required when testing on the local machine.

Issues

I requested changes due to a syntax error in the Python example. Please refer to the comment attached.

Examples to test

  • public/usage-examples/input/mouse_position-1-example.py

fill_circle(color_blue(), mouse_point.x, mouse_point.y, 8)
draw_circle(color_black(), mouse_point.x, mouse_point.y, 8)

refresh_screen(60)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refresh_screen does not take arguments; the method taking frequency as an argument is refresh_screen_with_target_fps

@Osaid2993
Copy link
Copy Markdown
Author

Hi @kottochii, thanks for pointing that out. I’ve updated the Python example and pushed the fix.

Copy link
Copy Markdown

@kottochii kottochii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peer review

All examples are working and all files show as required at the testing website. I approve this request.

@ekam313
Copy link
Copy Markdown

ekam313 commented Apr 3, 2026

Second Peer Review

I've reviewed the mouse_position usage example and checked it against proper testing and the usage example guide and style requirements.

Checks

  • All required files are present.
    • Example Title (.txt)
    • C++ code
    • C# code (top-level statements)
    • C# code (Object-Oriented Programming)
    • Python code
  • Code correctly uses SplashKit functions.
  • Code clearly demonstrates the function.
  • All versions maintain the same structure and behaviour.

Code Tests done

  • C++ code ran correctly.
  • C# top level code ran correctly.
  • C# OOP code ran correctly.
  • Python code ran correctly.

Website Tests done

  • npm run build
  • npm run preview

Review Summary

The example is clear, beginner-friendly, and demonstrates the mouse_position function effectively. The structure and behaviour are consistent across all language versions, and the implementation aligns well with the SplashKit usage example style guide.

Approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants