Jump to content

Loading effect


Dzsozi (h03)

Recommended Posts

  • Moderators

1.1 Create 1 white dot with photoshop. (high quality png is most of the time better)

https://wiki.multitheftauto.com/wiki/DxDrawImage

1.2 or https://wiki.multitheftauto.com/wiki/DxDrawText and use the • character.

2 Change the color of the image(white) or text

tocolor(255,255,255,255) -- white 
tocolor(200,200,200,255) -- light gray 
tocolor(155,155,155,255) -- gray 
tocolor(55,55,55,255) -- dark gray 
tocolor(0,0,0,255) -- black  

3 Use tickCount() to manage the progress.

Link to comment

[lua]

groups = { { r = 0, b = 0, g = 0, a = 255 }, {r = 0, g=0, b=0, a=255},{r=0,g=0,b=0,a=255}}

addEventHandler("onClientRender", root,

function ( )

dxDrawText( )

dxDrawText( )

dxDrawText( )

-- you have to divide your string into 3 parts somehow then for first text you can use the color code: groups[textNumber].r and as you see

-- here keep changing the alpha if you want to lighten and darken

-- then check if the alpha is 255 of last one first if it's then do it to first one

end

)

Link to comment

I've made something, but it's not working, well for the first frame it makes the effect, but after that there's gonna be a huge frame drop, and the text just bugs. It's not even above my head after my name.

  
local typingTextGroups = {{ r=20, b=70, g=200, a=0 }, {r=20, g=70, b=200, a=0}, {r=20,g=70,b=200,a=0}} 
local typingText = "• " 
  
addEventHandler("onClientRender", root, function ( ) 
                                                                dxDrawText(typingText, additionalX,additionalY,0,0,tocolor(typingTextGroups[1].r, typingTextGroups[1].g, typingTextGroups[1].b, typingTextGroups[1].a),additionalScale,font,"left","top",false,false,false,true,true) 
                                                                dxDrawText(typingText .. "" .. typingText, additionalX,additionalY,0,0,tocolor(typingTextGroups[2].r, typingTextGroups[2].g, typingTextGroups[2].b, typingTextGroups[2].a),additionalScale,font,"left","top",false,false,false,true,true) 
                                                                dxDrawText(typingText .. "" .. typingText .. "" .. typingText, additionalX,additionalY,0,0,tocolor(typingTextGroups[3].r, typingTextGroups[3].g, typingTextGroups[3].b, typingTextGroups[3].a),additionalScale,font,"left","top",false,false,false,true,true) 
                                                                if typingTextGroups[1].a == 0 and typingTextGroups[2].a == 0 and typingTextGroups[3].a == 0 then 
                                                                    typingTextGroups[1].a = 255 
                                                                    typingTextGroups[2].a = 0 
                                                                    typingTextGroups[3].a = 0 
                                                                elseif typingTextGroups[1].a == 255 and typingTextGroups[2].a == 0 and typingTextGroups[3].a == 0 then 
                                                                    typingTextGroups[1].a = 255 
                                                                    typingTextGroups[2].a = 255 
                                                                    typingTextGroups[3].a = 0 
                                                                elseif typingTextGroups[1].a == 255 and typingTextGroups[2].a == 255 and typingTextGroups[3].a == 0 then 
                                                                    typingTextGroups[1].a = 255 
                                                                    typingTextGroups[2].a = 255 
                                                                    typingTextGroups[3].a = 255 
                                                                elseif typingTextGroups[1].a == 255 and typingTextGroups[2].a == 255 and typingTextGroups[3].a == 255 then 
                                                                    typingTextGroups[1].a = 0 
                                                                    typingTextGroups[2].a = 0 
                                                                    typingTextGroups[3].a = 0 
                                                                end 
                                                            end) 
  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...