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> 

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

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.

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.

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