First off, you can think of screen_to_actor as a way of converting xy coordinates to a new coordinate system where the origin is the Event Actor. This is really only used with xmouse and ymouse, but what the function essentially does is change xmouse and ymouse within the script that you use screen_to_actor to be xy relative to the actor. You would only want to use this if you want the xmouse or ymouse to be in relation to your actor where (0,0) is now your actor.
For erase, it is a way of filling in a canvas completely, so the values are as follows. Usually people erase to black, or transparent, but erase does allow you to erase to red, or any other color you want.
- Code: Select all
erase(r,g,b,transp);
The & sends the address of a pointer, instead of the variable itself, since the screen_to_actor takes to int*, the ampersand is required. This is the main reason screen_to_actor is not used, as you would need to create int* and set them to use, while it is much easier to use basic math to accomplish the same thing.