This article is a stub. It may be incomplete, unfinished, or have missing parts/sections. If the article can be expanded, please do so! There may be suggestions on its talk page. (November 2024)
This page or section is in question as to whether it is useful or not. You can discuss whether you think it should be deleted or not on its talk page. (March 2025)
Reason: Probably not notable enough

This tutorial shows how to detect if the mouse is out of the project. This happens because the (x position) block and the (y position) block can only return values that are on the stage.

How to Make the Detector

Create a new sprite called "mouse out of project detector". Make a costume that is a 4x4 square. Create a new variable called "mouse out of screen" for all sprites, and put this in the code:

when gf clicked
set [ghost v] effect to [100]
forever
go to (mouse pointer v)
if <not <touching (mouse pointer v)?>> then
set [mouse out of screen v] to [1]
else
set [mouse out of screen v] to [0]
end
end

Uses for the Detector

Any project that requires the mouse to be in the project such as a maze using the mouse as the player will need to know if the mouse was moved out of bounds in order to cheat. This detector is useful for any project using the mouse to do something other than clicking without other mouse tracking.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.