Jump to content

Image Anim


SnoopCat

Recommended Posts

hey guys i was trying to make the thavelling image animation and i cant get it , my image disapeared.

can someone help me?

this is what i modified on the race_client.lua at travelling section

TravelScreen = {} 
TravelScreen.startTime = 0 
  
function TravelScreen.init() 
    local screenWidth, screenHeight = guiGetScreenSize() 
    local seconds = getTickCount() / 1600 
    local angle = math.sin(seconds) * 360 
    g_GUI['travelImage']   = guiCreateStaticImage(screenWidth/2-256, screenHeight/2-20, 512, 256, 'img/travelling.png', angle, 0, 0, false, nil) 
    g_dxGUI['travelText1'] = dxText:create('Travelling to:', screenWidth/2, screenHeight/2-130, false, 'bankgothic', 0.60, 'center' ) 
    g_dxGUI['travelText2'] = dxText:create('', screenWidth/2, screenHeight/2-100, false, 'bankgothic', 0.70, 'center' ) 
    g_dxGUI['travelText3'] = dxText:create('', screenWidth/2, screenHeight/2-40, false, 'bankgothic', 0.70, 'center' ) 
    g_dxGUI['travelText4'] = dxText:create('', screenWidth/2, screenHeight/2-70, false, 'bankgothic', 0.70, 'center' ) 
    g_dxGUI['travelText1']:color(255, 70, 0) 
    g_dxGUI['travelText4']:color(255, 70, 0) 
    hideGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3', 'travelText4') 
function HandleTheRendering ( ) 
    addEventHandler("onClientRender", getRootElement(), renderDisplay)  -- Keep everything visible with onClientRender. 
end 
addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) 
end 
  
function TravelScreen.show( mapName, authorName ) 
    TravelScreen.startTime = getTickCount() 
    g_dxGUI['travelText2']:text(mapName) 
    g_dxGUI['travelText3']:text(authorName and "" .. authorName or "") 
    g_dxGUI['travelText4']:text(authorName and "Author:" or "") 
    showGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3', 'travelText4') 
    guiMoveToBack(g_GUI['travelImage']) 
    playSound("audio/loading.wav") 
end 
  
function TravelScreen.hide() 
    hideGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3', 'travelText4') 
end 
  
function TravelScreen.getTicksRemaining() 
    return math.max( 0, TravelScreen.startTime + 3000 - getTickCount() ) 
end 

Link to comment

Yeah, I totally understand this:

[sarcasme on]

function HandleTheRendering ( ) 
    addEventHandler("onClientRender", getRootElement(), renderDisplay)  -- Keep everything visible with onClientRender. 
end 
addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) 
end 

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