GSDP:GAM100/CProcessing/worldMouseX

From Inside
Jump to: navigation, search

worldMouseX

Description

The system variable worldMouseX always contains the current horizontal coordinate of the mouse in world space. This means that the mouse position will be translated by any transformation functions called (translate() , scale() , scaleX() , scaleY() , rotate()). This will track the position of the mouse anywhere on the screen, even if the window is in the background.

Example

void draw() 
{
  background(color(200, 200, 200, 255));
  translate(mouseX, mouseY);
  line(0, 0, worldMouseX, worldMouseY);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>