Thanks but it ain't working as intended
https://imgur.com/a/PPAESu5
Desired should be centered in the gray rectangle:
My code:
local sW, sH = guiGetScreenSize();
local slotSize = 60;
local id, itm, x, y, iw, ih, rot = unpack(draging); --gather data
local r = 0;
local cx, cy = getCursorPosition();
local cx, cy = (cx*sW), (cy*sH);
local w, h = slotSize*iw, slotSize*ih;
if rot then
r = 90;
end
local rX, rY = rotatePos(cx, cy, w, h, r);
dxDrawImage(rX, rY, w, h, itm..".png", r);