Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- autor: Pat
- Nie zezwalam na używanie skryptu bez mojej zgody
- kontakt: igormeger@gmail.com
- ]]
- local texts={}
- local prepared_text =function(text,x,y,w,h,color,font)
- dxDrawText(text,x,y,w+x,h+y,color,1,dxGetFont(font),"center","center",true,true,true,false,false)
- end
- addEventHandler('onClientRender',root,function()
- for i,v in ipairs(texts) do
- if v['visible'] then
- local text = v['text']
- local x,y,w,h = v['pos']['x'],v['pos']['y'],v['pos']['w'],v['pos']['h']
- local color = v['color']
- local font = v['font']
- prepared_text(text, x,y,w,h, color, font)
- end
- end
- end)
- dxCreateText=function(text,x,y,w,h,color,font)
- table.insert(texts, {
- ['text']=text,
- ['pos']={
- ['x']=x,
- ['y']=y,
- ['w']=w,
- ['h']=h,
- },
- ['color']=color,
- ['font']=font,
- ['visible']=true,
- })
- return #texts
- end
- dxTextSetColor=function(textid,color)
- for i,v in ipairs(texts) do
- if i == textid then
- v['color']=color
- end
- end
- end
- dxTextSetVisible=function(textid,bool)
- for i,v in ipairs(texts) do
- if i == textid then
- v['visible']=bool
- end
- end
- end
- dxTextSetPosition=function(textid,x,y,w,h)
- for i,v in ipairs(texts) do
- if i == textid then
- v['pos']={
- ['x']=x,
- ['y']=y,
- ['w']=w,
- ['h']=h,
- }
- end
- end
- end
- dxDestroyText=function(textID)
- table.remove(texts,textID)
- end
- dxTextSetString=function(textID,textString)
- for i,v in ipairs(texts) do
- if i==textID then
- v['text']=textString
- end
- end
- end
- --[[
- local text = dxCreateText('sima',0,0,1000,25,tocolor(255,255,255,255),'default-bold')
- dxTextSetString(text, 'sima v2' )]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement