Karuzo Posted January 24, 2014 Share Posted January 24, 2014 Hello everybody, i have a few questions. I drew a window with DX , fine , but now i want it to make it more 'beautiful' , i have read something about easing on some topics. So i was at the wiki and looked for the Easing, ok, but now i don't really understand it . I don't know what these In/Out- Quads are , i just want to make my window from small to big, just like if i press f9 it 'pops' up. I think i can do that with inBounce and outBounce ( if im right :3 ) But i don't know how i could use them. Hope you understand me and help me Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 You can use this Useful Function As a guide, or simply use it. Link to comment
Wei Posted January 24, 2014 Share Posted January 24, 2014 https://wiki.multitheftauto.com/wiki/DxDrawAnimWindow You have a sample here Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 https://wiki.multitheftauto.com/wiki/DxDrawAnimWindowYou have a sample here That's what i just gave him. Link to comment
Karuzo Posted January 24, 2014 Author Share Posted January 24, 2014 Thank you , but does this work with Rectangles also ? Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 That creates a rectangle dx window with a title of your choice. You're Welcome. Link to comment
Karuzo Posted January 24, 2014 Author Share Posted January 24, 2014 Oh ok , now i understand Ok i've tried it , but doesn't work , why ? dxDrawAnimWindow ((screenW - 700) / 2, (screenH - 442) / 2, 700, 442, color, "default-bold", "OutBounce") Error : http://prntscr.com/2m4rxt Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 function content() local color = tocolor ( 0, 0, 0, 200 ) dxDrawAnimWindow ( "My Animated Window", 520, 600, color, "default-bold", "OutBounce") end addCommandHandler("open", function main() start = getTickCount() addEventHandler ( "onClientRender", getRootElement(), content ) end) function dxDrawAnimWindow(text,height,width,color,font,anim) local x,y = guiGetScreenSize() btwidth = width btheight = height/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, width, height, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btwidth, btheight, btheight/11, progress, anim) posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawRectangle ( posx, posy-y2, x2, y2, color ) dxDrawRectangle ( posx, posy, x1, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2,font,"center","center") end Link to comment
Karuzo Posted January 24, 2014 Author Share Posted January 24, 2014 Oh forgot that completely ok now it works, but what is if i have dx images on this rectangle ? do i have to set the positions from them also ? i mean do i have to put OutBounce also to them ? Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 You have to use 'interpolateBetween' using that usful funtion as an example. 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