.:HyPeX:. Posted July 6, 2014 Share Posted July 6, 2014 So my idea is pretty easy, how can i make the dxText to be cut off by the bounding box? So if i make the bounding box enlarge or stretch it will cut off letters, but so far it just displays the text completly, while the rectangle shows slowly... function RenderCreditStuff() --Check if not startup if not checkpoint then return end --Locals... local now = getTickCount() local duration = 5000 local ending = start + duration local elapsed = now - start local progress = elapsed / duration if elapsed < 1000 then --First Step Anim locals setup local duration = 1000 local ending = start + duration local elapsed = now - start local progress = elapsed / duration --First Step Anims local x1 = interpolateBetween(0, 0,0, x*0.4,0,0, progress, "InQuad") dxDrawRectangle(x*0.2, y*0.4, x1, y*0.1, tocolor(0,0,0,180)) elseif elapsed > 1000 and elapsed < 2000 then --Second Step Anim locals setup local duration = 1000 local start = start + 1000 local ending = start + duration local elapsed = now - start local progress = elapsed / duration --First Step finished Anims dxDrawRectangle(x*0.2, y*0.4, x*0.4, y*0.1, tocolor(0,0,0,180)) --Second Step Anims local x1 = interpolateBetween(0, 0,0, x*0.4,0,0, progress, "InQuad") dxDrawText("Map: Unknown", x*0.2, y*0.4, x1, y*0.1,tocolor(255,255,255,255), 1, DxFont, "left", "top",true,false,true,true,true) dxDrawRectangle(x*0.2, y*0.5, x1, y*0.1, tocolor(0,0,0,180)) else end end addEventHandler('onClientRender', root, RenderCreditStuff) Link to comment
Den. Posted July 7, 2014 Share Posted July 7, 2014 I think you're giving dxDrawText the width and height of the rectangle, instead of it's right and bottom absolute coordinates. Try this? dxDrawText("Map: Unknown", x*0.2, y*0.4, (x*0.2)+x1, (y*0.4)+(y*0.1),tocolor(255,255,255,255), 1, DxFont, "left", "top",true,false,true,true,true) Link to comment
.:HyPeX:. Posted July 8, 2014 Author Share Posted July 8, 2014 If that was the problem, it would still work, since the text would be at some point (going from -0,2 to +0,2) cutting of the text, and it never does. 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