drk Posted September 1, 2011 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?
CapY Posted September 1, 2011 Posted September 1, 2011 (edited) Wiki . https://wiki.multitheftauto.com/wiki/Cli ... _functions Edited September 1, 2011 by Guest
darkdreamingdan Posted September 1, 2011 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
drk Posted September 3, 2011 Author Posted September 3, 2011 Wiki .https://wiki.multitheftauto.com/wiki/Cli ... _functions -.- If I had found something about it, you think I posted? -.-
drk Posted September 13, 2011 Author 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
JR10 Posted September 13, 2011 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.
drk Posted September 14, 2011 Author 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)
JR10 Posted September 14, 2011 Posted September 14, 2011 Check the function arguments. You didn't specify the width or height.
brad Posted September 14, 2011 Posted September 14, 2011 not much but check and change the arguments and in function drawImage() I try not to use uppercase
JR10 Posted September 14, 2011 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.
drk Posted September 16, 2011 Author Posted September 16, 2011 Woooow ! It worked Thanks very much JR10 !
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