function guiSetStaticImageMovable(Element,state)
assert(getElementType(Element) == 'gui-staticimage', "Bad argument 1 @ guiSetStaticImageMovable [gui-staticimage expected, got "..type(Element).."]")
assert(type(state) == "boolean", "Bad argument 2 @ guiSetStaticImageMovable [boolean expected, got "..type(state).."]")
return setElementData(Element,'Movable',state) or false
end
function Hold( t,x,y )
if t ~= "left" or not getElementData(source,'Movable') then return end
local lp = Vector2(guiGetPosition(source,false));
lx = {x-lp.x,y-lp.y};
yl = source;
end
function Drop( xo, x, y )
if xo ~= "left" then return end
yl = nil;
end
function Move( _, _, x, y )
if yl then
guiSetPosition(yl,x-lx[1],y -lx[2],false);
end
end
addEventHandler( "onClientGUIMouseDown", root,Hold) addEventHandler( "onClientGUIMouseUp", root,Drop) addEventHandler( "onClientCursorMove", root,Move)
GUIEditor = {
button = {},
staticimage = {},
label = {},
memo = {}
}
local screenW, screenH = guiGetScreenSize()
GUIEditor.staticimage[1] = guiCreateStaticImage((screenW - 444) / 2, (screenH - 357) / 2, 444, 357, "TR.png", false)
guiSetStaticImageMovable(GUIEditor.staticimage[1],true)
GUIEditor.label[1] = guiCreateLabel(1, 5, 443, 17, "LabelNumb1", false, GUIEditor.staticimage[1])
guiSetFont(GUIEditor.label[1], "default-bold-small")
guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false)
GUIEditor.button[1] = guiCreateButton(19, 89, 163, 52, "btn1", false, GUIEditor.staticimage[1])
GUIEditor.button[2] = guiCreateButton(250, 89, 163, 52, "btn2", false, GUIEditor.staticimage[1])
GUIEditor.memo[1] = guiCreateMemo(14, 151, 409, 192, "", false, GUIEditor.staticimage[1])
هذي الاكواد الي مسويها ماتوقع في مشكلة بالي حاطه انا :\