'LinKin Posted December 5, 2013 Share Posted December 5, 2013 Hello, As you know, it exists a script for making animations with an image. (i.e Hurry up! Image in Race) But I was wondering, if there's a way to apply animations like these to a text draw by dxDrawText. Seems impossible for me, but I want to make sure Thanks, LinKin. Link to comment
ZL|LuCaS Posted December 5, 2013 Share Posted December 5, 2013 (edited) Hello,As you know, it exists a script for making animations with an image. (i.e Hurry up! Image in Race) But I was wondering, if there's a way to apply animations like these to a text draw by dxDrawText. Seems impossible for me, but I want to make sure Thanks, LinKin. "talk more about this animation(type animation)" Edited December 5, 2013 by Guest Link to comment
tosfera Posted December 5, 2013 Share Posted December 5, 2013 You can do that, on the client render you should use some math functions and if-statements to make the text size increase and decrease. Link to comment
codeluaeveryday Posted December 5, 2013 Share Posted December 5, 2013 You are also able to rotate text Link to comment
'LinKin Posted December 5, 2013 Author Share Posted December 5, 2013 Uh, any example? Link to comment
Driggero Posted December 5, 2013 Share Posted December 5, 2013 If you're looking to move the text from one position to another, or one scale to another (anything you can edit about it really) then you can use interpolateBetween Combined with the several easing functions you can make all sorts of animations with this function Link to comment
ZL|LuCaS Posted December 5, 2013 Share Posted December 5, 2013 Uh, any example? if you had paid attention to my question would already have your text with animation. Link to comment
Gallardo9944 Posted December 6, 2013 Share Posted December 6, 2013 Didn't test though. local x,y = guiGetScreenSize() local defScale = 1 local currentScale = defScale local maxScale = 3 local step = 0.3 -- How fast to change the size local turn = true -- true = increase size, false = decrease size local font = "default-bold" local text = "This texts pulses" function renderPulse() if turn == true then -- If we increase the value currentScale = currentScale + step if currentScale > maxScale then currentScale = maxScale turn = false -- Reached max? Then make it go back end else currentScale = currentScale - step if currentScale < defScale then currentScale = defScale turn = true end end local width = dxGetTextWidth(text,currentScale,font) local height = dxGetFontHeight(currentScale,font) dxDrawText(text,x/2-width/2,y/2-height/2,width,height,tocolor(255,255,255,255),currentScale,font) end addEventHandler("onClientRender",getRootElement(),renderPulse) 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