Jump to content

dxDrawImage(from wiki)


Pierce

Recommended Posts

Posted

ive changed just image name in script but other stuff is from wiki

local screenWidth,screenHeight = guiGetScreenSize()  -- Get screen resolution. 
  
  
function renderDisplay ( ) 
    local seconds = getTickCount() / 1000 
    local angle = math.sin(seconds) * 80 
    -- This will draw the graphic file 'arrow.png' at the top middle of the screen 
    -- using the size of 100 pixels wide, and 240 pixels high. 
    -- The center of rotation is at the top of the image. 
    dxDrawImage ( screenWidth/2 - 50, 0, 100, 240, 'lvl61.png', angle, 0, -120 ) 
end 
  
  
function HandleTheRendering ( ) 
    addEventHandler("onClientRender", getRootElement(), renderDisplay)  -- Keep everything visible with onClientRender. 
end 
addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) 

this doesn't draw this picture

level_ico_61.gif

no errors

my res is 1920x1080

Posted
<meta> 
<script src="script.lua" type="client" /> 
<file src="lvl61.png" /> 
</meta> 

i guess the image was damaged or something,idk how,but when i changed image,it worked

Posted

Make sure the image is located in your resource's root folder. IE, "resources/MyResource/lvl61.png".

Then add this to your meta file;

<file src="lvl61.png"/> 

Edit:

You beat me to it, glad you got it working :)

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