Jump to content

Help dxDrawRectangle


jhonatajh

Recommended Posts

Posted

I'm beginning to set on the moon language, but I'm having a hard time making the drawRectacle to move the variable ls from the bottom up, does anyone know how I can make it move?

From top to bottom or from bottom to top! In my case, it is from the bottom up.

dxDrawRectangle(sx/2-10,200,10,128*(12768/ls)+100,colors[1]) 

Posted

Try this :

local screenWidth, screenHeight = guiGetScreenSize ( ) 
local h = 1050 
  
function YourCode () 
    dxDrawRectangle(screenWidth*(0/1366),screenHeight*(h/768),screenWidth*(<<< size >>>/1366),screenHeight*(<<< size >>>/768),colors[1]) 
     h = h - 1 
        if ( h <= - 1050 ) then 
        h = 1050 
    end 
end 
addEventHandler("onClientRender", root, YourCode) 

Change <<< size >>> with your code numbers.

Posted

I managed to do, but is showing a slash, I need two or more

function clientRenderFunc() 
    if(handl) then 
    local ls,rs = - getSoundLevelData(handl) 
    if(ls ~= false) then 
          dxDrawRectangle(sx/2-10,200,10,128*(12768/ls),colors[1]) 
          dxDrawRectangle(sx/2-20,200,10,128*(12768/rs),colors[2]) 
          dxDrawText("\n\n\n\n Tecle 0 para desligar a radio ou 9 pra ligar!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) 
          dxDrawText("\n\n\n Quer Ser um Locutor? Entre em contato com Dono servidor!!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) 
    end 
     
    end 
end 

Posted

try this: (tested)

function clientRenderFunc() 
    if(handl) then 
 local ls,rs = getSoundLevelData(handl) 
  if(ls ~= false) then 
    dxDrawRectangle(sx/2-10,screenHeight,10,128*(-ls/32768),colors[1]) 
    dxDrawRectangle(sx/2+10,screenHeight,10,128*(-rs/32768),colors[2]) 
     dxDrawText("\n\n\n\n Tecle 0 para desligar a radio ou 9 pra ligar!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) 
     dxDrawText("\n\n\n Quer Ser um Locutor? Entre em contato com Dono servidor!!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) 
  end 
    end 
end 

@Walid, have to study more, and not ignore the topic.

if you started to help, help him to the end :wink:

Posted
try this: (tested)
function clientRenderFunc() 
    if(handl) then 
 local ls,rs = getSoundLevelData(handl) 
  if(ls ~= false) then 
    dxDrawRectangle(sx/2-10,screenHeight,10,128*(-ls/32768),colors[1]) 
    dxDrawRectangle(sx/2+10,screenHeight,10,128*(-rs/32768),colors[2]) 
     dxDrawText("\n\n\n\n Tecle 0 para desligar a radio ou 9 pra ligar!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) 
     dxDrawText("\n\n\n Quer Ser um Locutor? Entre em contato com Dono servidor!!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) 
  end 
    end 
end 

@Walid, have to study more, and not ignore the topic.

if you started to help, help him to the end :wink:

Thanks, man

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...