DaweeVokCs Posted July 19, 2016 Share Posted July 19, 2016 Hello everybody. I saw a video on YouTube a new MTA server comes names called "Drift Paradise". I see their and I got eyegasm. I want to code myself this panel but I don't how to start how to build this code up how to achieve it. (SORRY FOR MY "not good at all" ENGLISH ) Someone could help me to see how it should be made it? I think need to use: GetCursorPosition() dxDrawRectangle() dxDrawText() I would really appreciate if someone would help me... Here is the video if you not found the link in the TEXT: Link to comment
Gallardo9944 Posted September 8, 2016 Share Posted September 8, 2016 First thing to do is to create a texture shader. Just a simple one which will store your interface (dxCreateShader). Then, you should make a render target (dxCreateRenderTarget) and draw all your interface in it (dxSetRenderTarget) After that, calculations come in. Your 0;0 position is mid-screen. Specify how hard you want to rotate the shader: like -15 to 15 degrees. Do some math for degrees calculation: local ox,oy = 0,0 -- We will use it for current offset local mx,my = 15,15 -- 15 degrees for x and y position local rt = dxCreateRenderTarget(sx,sy,true) --replace sx,sy with the size of the box local shader = dxCreateShader(shaderfile) -- replace shaderfile with path to your texture shader function updateRotation() dxSetRenderTarget(rt) -- Draw your interface here dxSetRenderTarget() dxSetShaderValue(shader,"texture",rt) -- Pass the render target to the shader local px,py = getCursorPosition() ox,oy = (px-0.5)*mx,(py-0.5)*my -- mid screen (0.5) will make 0 for ox,oy values. Others are relative dxSetShaderTransform(shader,ox,oy) -- Here goes your main magic -- And just draw your shader mid-screen here with dxDrawImage end addEventHandler("onClientRender",root,updateRotation) -- We wanna do it each frame, right? 1 Link to comment
qaisjp Posted September 8, 2016 Share Posted September 8, 2016 They could just be using CEF Link to comment
draobrehtom Posted September 9, 2016 Share Posted September 9, 2016 5 hours ago, qaisjp said: They could just be using CEF I don't think so. I know a guy who did that, and he exactly did this without CEF. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now