local Q=require("\114\097\121\108\105\098")local z,p=1280,720 Q.SetConfigFlags(Q.FLAG_WINDOW_UNDECORATED)Q.InitWindow(z,p,"\114\097\121\103\117\105 - \112\111\114\116\097\098\108\101 \119\105\110\100\111\119")Q.SetTargetFPS(75)local U=Q.Vector2(0,0)local j=Q.GetWindowPosition()local W=Q.Vector2(U.x,U.y)local K=false local m=false while not m and not Q.WindowShouldClose()do U=Q.GetMousePosition()if Q.IsMouseButtonPressed(Q.MOUSE_BUTTON_LEFT)then if Q.CheckCollisionPointRec(U,Q.Rectangle(0,0,z,20))then K=true W=Q.Vector2(U.x,U.y)end end if K then j=(j+U)-W if Q.IsMouseButtonReleased(Q.MOUSE_BUTTON_RIGHT)then K=false end Q.SetWindowPosition(j.x,j.y)end Q.BeginDrawing()Q.ClearBackground(Q.RAYWHITE)m=Q.GuiWindowBox(Q.Rectangle(0,0,z,p),"\080\079\082\084\065\066\076\069 \087\073\078\068\079\087")Q.DrawText(string.format("\077\111\117\115\101 \080\111\115\105\116\105\111\110\058 \091 \037\046\048\102\044 \037\046\048\102 \093",U.x,U.y),10,40,10,Q.DARKGRAY)Q.EndDrawing()end Q.CloseWindow()
local rl = require("raylib")

local width, height = 1280, 720

rl.SetConfigFlags(rl.FLAG_WINDOW_UNDECORATED)
rl.InitWindow(width, height, "raygui - portable window")
rl.SetTargetFPS(75)

local mouse_pos = rl.Vector2(0, 0)
local window_pos = rl.GetWindowPosition()
local pan_offset = rl.Vector2(mouse_pos.x, mouse_pos.y)

local drag_window = false
local exit_window = false

while not exit_window and not rl.WindowShouldClose() do
  mouse_pos = rl.GetMousePosition()

  if rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_LEFT) then
    if rl.CheckCollisionPointRec(mouse_pos, rl.Rectangle(0, 0, width, 20)) then
      drag_window = true
      pan_offset = rl.Vector2(mouse_pos.x, mouse_pos.y)
    end
  end

  if drag_window then
    window_pos = window_pos + mouse_pos - pan_offset

    if rl.IsMouseButtonReleased(rl.MOUSE_BUTTON_RIGHT) then
      drag_window = false
    end

    rl.SetWindowPosition(window_pos.x, window_pos.y)
  end

  rl.BeginDrawing()

  rl.ClearBackground(rl.RAYWHITE)
  exit_window = rl.GuiWindowBox(rl.Rectangle(0, 0, width, height), "PORTABLE WINDOW")
  rl.DrawText(string.format("Mouse Position: [ %.0f, %.0f ]", mouse_pos.x, mouse_pos.y), 10, 40, 10, rl.DARKGRAY)

  rl.EndDrawing()
end

rl.CloseWindow()
