Jump to content

[HELP]problem with export function


tatusmen

Recommended Posts

Hi everyone.

I want to export a one function but it doesn't work. I don't know what I do wrong. :(

This is first resource: RESOURCENAME: animwin

• meta.xml:


• the function: anim.lua

function dxDrawAnimWindow(text,height,width,color,font,anim) 
    local x,y = guiGetScreenSize() 
  
    btwidth = width 
    btheight = height/20 
  
    local now = getTickCount() 
    local elapsedTime = now - start 
    local endTime = start + 1500 
    local duration = endTime - start 
    local progress = elapsedTime / duration 
    local x1, y1, z1 = interpolateBetween ( 0, 0, 0, width, height, 255, progress, anim) 
    local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btwidth, btheight, btheight/11, progress, anim) 
  
    posx = (x/2)-(x1/2) 
    posy = (y/2)-(y1/2) 
  
    dxDrawRectangle ( posx, posy-y2, x2, y2, color ) 
    dxDrawRectangle ( posx, posy, x1, y1, tocolor ( 0, 0, 0, 200 ) ) 
    dxDrawText ( text, 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2,font,"center","center")    
  
  
end 

function is working

second resource: RESOURCENAME: animwin2

• meta.xml:


• file which I can export the function from first resource: client.lua

function content() 
    local color = tocolor ( 0, 0, 0, 200 ) 
    exports.animwin:dxDrawAnimWindow(".", 500, 500, color, "default-bold", "OutBounce") 
    --call(getResourceFromName("animwin"), "dxDrawAnimWindow", ".", 500, 500, color, "default-bold", "OutBounce") 
end 
function main() 
     start = getTickCount() 
     addEventHandler ( "onClientRender", getRootElement(), content ) 
end 
bindKey ( "F2", "down", main ) 

The debugscript error:

IRIDkvn.png

Please help me :(.

Sorry for my English.

Link to comment

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