TrapLord Studios™ Posted August 4, 2013 Share Posted August 4, 2013 I would like to know, is it possible to make dx draw appear by command, then fade automatically, If so can some one explain to me how ? Thanks -Logic Link to comment
Vector Posted August 4, 2013 Share Posted August 4, 2013 (edited) -- this will draw "hallo" in the middle of the screen for 5 seconds when you use the command hallo local timer; local function draw () local screenWidth, screenHeight = guiGetScreenSize (); dxDrawText ("hallo", screenWidth/2-50,screenHeight,0,0, tocolor(255,0,0,255), 1, "pricedown"); end; addCommandHandler ("hallo", function () if isTimer (timer) then -- is message shown already? -- if it is, just draw message for 5 more seconds. resetTimer (timer); else -- not, so ... addEventHandler ("onClientRender", getRootElement(), draw); -- timer to hide the message 5 seconds later. timer = setTimer (removeEventHandler,5000,1, "onClientRender", getRootElement(), draw); end; end); Edited August 4, 2013 by Guest 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