Karuzo Posted January 31, 2014 Share Posted January 31, 2014 Hey Guys, so i have a dximages with some buttons and dx images. Everythings works perfectly, but i wanted to make it more 'special'. So i have a question. How do i let my images fly in ? I mean , it comes from the bottom of the screen to the middle. I hope you understand me and could help me regards, KRZO. Link to comment
pa3ck Posted January 31, 2014 Share Posted January 31, 2014 I've never used this 'function' but give it a try: https://wiki.multitheftauto.com/wiki/DxDrawAnimWindow Remember, its not an MTA function, you will need to copy - paste the whole code and use dxDrawAnimWindow(arguments..) to call the function. Link to comment
Karuzo Posted January 31, 2014 Author Share Posted January 31, 2014 Thank you pa3ck, but i have another question, would this work with images also ? Cause i don't think so. Link to comment
Djdidier Posted January 31, 2014 Share Posted January 31, 2014 You can use interpolate between to give it that animation https://wiki.multitheftauto.com/wiki/InterpolateBetween Link to comment
Gallardo9944 Posted January 31, 2014 Share Posted January 31, 2014 here is an example (untested): local step = 0.05 -- Progress speed per frame (from 0 to 1.0) local x,y = guiGetScreenSize() -- get screen size local sx,sy = 400,300 -- predefining the size local px,py = x/2-sx/2,y -- middle of the screen by X, right behind the visible Y part. x/2-sx/2 stands for the middle of the screen. y means "after" the bottom screen edge local progress = 0 function renderWindow() progress = progress + step -- Increasing the progress each frame if progress > 1 then -- Progress can't be more than 1 so let's limit it progress = 1 end py = interpolateBetween(y,0,0,y/2-sy/2,0,0,progress,"OutBounce") -- Look for "easing" in wiki to change the animation type dxDrawRectangle(px,py,sx,sy,tocolor(0,0,0,170)) -- Rectangle as an example end addEventHandler("onClientRender",getRootElement(),renderWindow) 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