Jump to content

Image Resource: Help me !


drk

Recommended Posts

If you want to fade through various resources, you'll want to start by looking at either guiCreateStaticImage or dxDrawImage on the Wiki. In order to do fade animations, the easiest way is probably to use arc's animation library, which comes with the Race gamemode. If you take out the animation script, i believe it has some built-in fade functions.

You may also want to check the new easing functions such as interpolateBetween

https://wiki.multitheftauto.com/wiki/InterpolateBetween

Link to comment
  • 2 weeks later...

Hey, ive used the arc_ animation library and Race Gamemode to create the image resource. The code is it:

  
--[[----------------------------------------- 
-- Client Side Image Script 
--@author +iMortal 
--@description Client Side Image Script 
-----------------------------------------]]-- 
  
function drawImage() 
        local screenWidth, screenHeight = guiGetScreenSize() 
        image1 = guiCreateStaticImage(screenWidth/2, screenHeight/40, 'gfx/img/one.png', false, nil) 
        guiSetAlpha(image1, 0) 
        Animation.createAndPlay(image1, Animation.presets.guiFadeIn(800)) 
        Animation.createAndPlay(image1, Animation.presets.guiPulse(1000)) 
    end 
addEventHandler ( "onClientResourceStart", getRootElement(), drawImage) 
  

The image is in directory: gfx/img/one.png. But the image not appear, the type in meta.xml is client, arc_ library type=client, the code type is client but not appear, in console not appear erros and in /debugscript .

Help me, and sorry for my baaad english :S

Link to comment
function drawImage() 
        local screenWidth, screenHeight = guiGetScreenSize() 
        image1 = guiCreateStaticImage(screenWidth/2, screenHeight/40, 'gfx/img/one.png', false, nil) 
        guiSetAlpha(image1, 1) 
        Animation.createAndPlay(image1, Animation.presets.guiFadeIn(800)) 
        Animation.createAndPlay(image1, Animation.presets.guiPulse(1000)) 
    end 
addEventHandler ( "onClientResourceStart", getRootElement(), drawImage) 

EDIT: Yes, 0 alpha is transparent.

Link to comment

Dont work :(

The code is:

--[[----------------------------------------- 
-- Client Side Image Script 
--@author +iMortal 
--@description Client Side Image Script 
-----------------------------------------]]-- 
  
function drawImage() 
            local screenWidth, screenHeight = guiGetScreenSize() 
            image1 = guiCreateStaticImage(screenWidth/2, screenHeight/40, 'gfx/img/one.png', false) 
            Animation.createAndPlay(image1, Animation.presets.guiFadeIn(800)) 
            Animation.createAndPlay(image1, Animation.presets.guiPulse(1000)) 
  end 
addEventHandler ( "onClientResourceStart", getRootElement(), drawImage) 

Link to comment
function drawImage() 
            local screenWidth, screenHeight = guiGetScreenSize() 
            image1 = guiCreateStaticImage(screenWidth/2, screenHeight/40,100,100,  'gfx/img/one.png', false) 
            Animation.createAndPlay(image1, Animation.presets.guiFadeIn(800)) 
            Animation.createAndPlay(image1, Animation.presets.guiPulse(1000)) 
  end 
addEventHandler ( "onClientResourceStart", getRootElement(), drawImage) 

But you will have to edit it, to suit you.

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