Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y = guiGetScreenSize()
- function isCursorOnElement(x,y,w,h)
- if isCursorShowing() then
- local mx,my = getCursorPosition()
- local fullx,fully = guiGetScreenSize()
- cursorx,cursory = mx*fullx,my*fully
- if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
- return true
- else
- return false
- end
- end
- end
- function dxSetVisible( element, state )
- if ( element ) then
- element.activ = state;
- else
- return outputDebugString("Failed setVisible dxElement!");
- end
- end
- function dxGetVisible( element )
- if ( element ) then
- return(element.activ);
- else
- return outputDebugString("Failed getVisible dxElement!");
- end
- end
- function dxGetText( element )
- if ( element ) then
- return tostring(element.text);
- else
- return outputDebugString("Failed getText dxElement!");
- end
- end
- function dxSetText( element, text )
- if ( element ) then
- element.text = tostring(text)
- else
- return outputDebugString("Failed setText dxElement!");
- end
- end
- function dxGetPosition( element, relativ )
- if ( element ) then
- if ( relativ ) then
- local rX, rY = element.x/100, element.y/100; -- Die genaue berechnung kenne ich nicht mehr.
- return rX, rY;
- else
- return element.x, element.y;
- end
- else
- return outputDebugString("Failed getPosition dxElement!");
- end
- end
- function dxSetPosition( element, rx, ry, relativ )
- if ( element ) and ( rx ) and ( ry ) then
- element.x = rx
- element.y = ry
- else
- return outputDebugString("Failed setPosition dxElement!");
- end
- end
- function dxGetSize( element )
- if ( element ) then
- return element.w, element.h;
- else
- return outputDebugString("Failed getSize dxElement!");
- end
- end
- function dxSetSize( element, rw, rh )
- if ( element ) and ( rw ) and ( rh ) then
- element.w = rw;
- element.h = rh;
- else
- return outputDebugString("Failed setSize dxElement!");
- end
- end
- function dxSetColor( element, r, g, b )
- if ( element ) and ( r ) and ( g ) and ( b ) then
- element.r = r;
- element.g = g;
- element.b = b;
- else
- return outputDebugString("Failed setColor dxElement!");
- end
- end
- function dxSetAlpha( element, newalpha )
- if ( element ) and ( newalpha ) then
- element.alpha = newalpha
- else
- return outputDebugString("Failed setAlpha dxElement!");
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement