local Q=require("\114\097\121\108\105\098")Q.SetTraceLogLevel(Q.LOG_WARNING)Q.SetConfigFlags(Q.FLAG_VSYNC_HINT)Q.InitWindow(800,450,"\114\097\121\108\105\098 \091\099\111\114\101\093 \101\120\097\109\112\108\101 - \109\111\117\115\101 \105\110\112\117\116")local z=Q.Vector2(-100,-100)local p=Q.DARKBLUE while not Q.WindowShouldClose()do z.x=Q.GetMouseX()z.y=Q.GetMouseY()if Q.IsMouseButtonPressed(Q.MOUSE_BUTTON_LEFT)then p=Q.MAROON elseif Q.IsMouseButtonPressed(Q.MOUSE_BUTTON_MIDDLE)then p=Q.LIME elseif Q.IsMouseButtonPressed(Q.MOUSE_BUTTON_RIGHT)then p=Q.DARKBLUE end Q.BeginDrawing()Q.ClearBackground(Q.RAYWHITE)Q.DrawCircleV(z,40,p)Q.DrawText("\109\111\118\101 \098\097\108\108 \119\105\116\104 \109\111\117\115\101 \097\110\100 \099\108\105\099\107 \109\111\117\115\101 \098\117\116\116\111\110 \116\111 \099\104\097\110\103\101 \099\111\108\111\114",10,10,20,Q.DARKGRAY)Q.EndDrawing()end Q.CloseWindow()
local rl = require("raylib")

rl.SetTraceLogLevel(rl.LOG_WARNING)
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
rl.InitWindow(800, 450, "raylib [core] example - mouse input")

local ball_position = rl.Vector2(-100, -100)
local ball_color = rl.DARKBLUE

while not rl.WindowShouldClose() do
  ball_position.x = rl.GetMouseX()
  ball_position.y = rl.GetMouseY()

  if rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_LEFT) then
    ball_color = rl.MAROON
  elseif rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_MIDDLE) then
    ball_color = rl.LIME
  elseif rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_RIGHT) then
    ball_color = rl.DARKBLUE
  end

  rl.BeginDrawing()

  rl.ClearBackground(rl.RAYWHITE)
  rl.DrawCircleV(ball_position, 40, ball_color)
  rl.DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.DARKGRAY)

  rl.EndDrawing()
end

rl.CloseWindow()
