Jump to content

dxDrawImage


Recommended Posts

Posted

None of these images are showing up when I start the resource.

Could anyone help please?

client.lua

function draw() 
         
dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
         
dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
         
dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
         
dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
     
end 
  
) 
function HandleTheRendering ( ) 
addEventHandler("onClientRender", getRootElement(), draw) 
end 
addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) 

Meta.xml

 <meta> 
    <info author="Booker" name="image" version="0.1" type="script"/> 
    <script src="client.lua" type="client" /> 
  
    <!--  gameplay icons  --> 
    <file src="mtalogo.png" /> 
  
</meta> 

560x95_FFFFFF_FF9900_000000_000000.png
Posted (edited)

Why the onClientResourceStart? Why?

function draw() 
        
dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    
end 
addEventHandler("onClientRender", getRootElement(), draw) 
  

The same thing... i don't think the problem was in that, the debug doesn't output anything?

EDIT: You had ')' in the code that didn't close anything.

Edited by Guest

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

Posted
addEventHandler("onClientRender", root, 
function ()        
dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    
end 
  
) 

Posted
addEventHandler("onClientRender", root, 
function ()        
dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    
end 
  
) 

You didn't change anything there... the same code.

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

Posted
addEventHandler("onClientRender", root, 
function ()        
dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    
end 
  
) 

You didn't change anything there... the same code.

it should work anyway ( one or another ).. Once I had same problem, but when I changed code to this it worked xD

Posted
Nope. still nothing. :/

try something silly.. if this dosen't work, maybe your coords aren't alright :

addEventHandler("onClientResourceStart", resourceRoot, 
    function()     
    end 
) 
addEventHandler("onClientRender", root, 
function ()        
dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    
end 
  
) 
  

Posted
addEventHandler ( "onClientRender", root, 
    function ( ) 
        outputChatBox ( "RENDERING IMAGES" ) 
        dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    end 
) 

Use that and see what it outputs to the chat box.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

lol, deleting this from the meta will make the script work! great thinking, my friend!

<!--  gameplay icons  --> 

And this scripts works, except there was an extra ")" near the end of "draw" function.

function draw() 
        
dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        
dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    
end 
  
function HandleTheRendering ( ) 
addEventHandler("onClientRender", getRootElement(), draw) 
end 
addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) 

  • MTA Team
Posted
lol, deleting this from the meta will make the script work! great thinking, my friend!

<!--  gameplay icons  --> 

That, should NOT be the case.

Posted

Well, and what was the problem?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

So, that means that he never used my code at all, which has no errors.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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