drk Posted September 1, 2011 Share Posted September 1, 2011 Hi! Can someone help me to create a resource that is running my images on the screen? Example: Brasil Mortal Oficial (First image) | SERVER-IP (Second image) but with Fade. Can anyone help me please? Link to comment
CapY Posted September 1, 2011 Share Posted September 1, 2011 (edited) Wiki . https://wiki.multitheftauto.com/wiki/Cli ... _functions Edited September 1, 2011 by Guest Link to comment
darkdreamingdan Posted September 1, 2011 Share Posted September 1, 2011 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
drk Posted September 3, 2011 Author Share Posted September 3, 2011 Wiki .https://wiki.multitheftauto.com/wiki/Cli ... _functions -.- If I had found something about it, you think I posted? -.- Link to comment
drk Posted September 13, 2011 Author Share Posted September 13, 2011 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 Link to comment
mjau Posted September 13, 2011 Share Posted September 13, 2011 you added the file line in meta ? Link to comment
drk Posted September 13, 2011 Author Share Posted September 13, 2011 it is guiSetAlpha ? Link to comment
JR10 Posted September 13, 2011 Share Posted September 13, 2011 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
drk Posted September 14, 2011 Author Share Posted September 14, 2011 Thanks I'll test now Link to comment
drk Posted September 14, 2011 Author Share Posted September 14, 2011 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
JR10 Posted September 14, 2011 Share Posted September 14, 2011 Check the function arguments. You didn't specify the width or height. Link to comment
brad Posted September 14, 2011 Share Posted September 14, 2011 not much but check and change the arguments and in function drawImage() I try not to use uppercase Link to comment
JR10 Posted September 14, 2011 Share Posted September 14, 2011 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
drk Posted September 16, 2011 Author Share Posted September 16, 2011 Woooow ! It worked Thanks very much JR10 ! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now