2.1.1 Position

The position of the mouse pointer on the screen is a Vec2. The function Ms.pos() returns the current position. The following code example shows the current mouse position on the screen.

 
Vec2 mousePos; 
 
void InitPre() 
{ 
5   EE_INIT(); 
} 
 
bool Init() 
{ 
10   return true
} 
 
void Shut() {} 
 
15bool Update() 
{ 
   if(Kb.bp(KB_ESC)) return false
   mousePos = Ms.pos(); 
   return true
20} 
 
void Draw() 
{ 
   D.clear(BLACK); 
25   mousePos.draw(RED); 
}  

Exercise
Use the example above, but instead of showing this position right below the mouse pointer, show it a little bit below.