JAY.ANN Posted September 4, 2022 Share Posted September 4, 2022 Hey, guys. I would like to get some help with a small issue - i need to change one dxDrawImage to another and I don't know how to realise it. I need to change my image From this: https://imgur.com/OtxXaRZ To this: https://imgur.com/YxegjYL I would be very grateful for any help! Link to comment
AliGR Posted September 4, 2022 Share Posted September 4, 2022 hello , you can use variable to change the image path = "img1.png" addEventHandler("onClientRender",root,funtion() dxDrawImage ( 100, 300, 100, 240, path, 0, 0, 0,tocolor(255,255,255) ) end) addCommandHandler("changeimage",function() path = "img2.png" end) 1 Link to comment
JAY.ANN Posted September 4, 2022 Author Share Posted September 4, 2022 3 minutes ago, AliGR said: hello , you can use variable to change the image path = "img1.png" addEventHandler("onClientRender",root,funtion() dxDrawImage ( 100, 300, 100, 240, path, 0, 0, 0,tocolor(255,255,255) ) end) addCommandHandler("changeimage",function() path = "img2.png" end) I tried to do something like that but it didn't worked Link to comment
AliGR Posted September 4, 2022 Share Posted September 4, 2022 2 hours ago, JAY.ANN said: I tried to do something like that but it didn't worked Send your code Link to comment
JAY.ANN Posted September 4, 2022 Author Share Posted September 4, 2022 --FUNCTIONS BELOW GETTING ON CLIENT RENDER EVENT WHEN THE PLAYER ENTERS SPECIFIED MARKER function drawActionButton() local action_button = dxDrawImage( 1080 * sW, actionButtonHeight * sH, 64 * sW, 64 * sH, action_image, 0, 0, 0, tocolor( 255, 255, 255, actionButtonAlpha ) ) dxDrawText( actionButton[ 1 ], 1099 * sW, ( actionButtonHeight + 1 ) * sH, 20 * sW, 45 * sH, tocolor( 25, 25, 25, actionButtonAlpha ), 1, gilroyActionButton ) dxDrawText( actionButtonTitle, 1155 * sW, actionButtonHeight * sH, 20 * sW, 45 * sH, tocolor( 255, 255, 255, actionButtonAlpha ), 1, segoeBold20 ) dxDrawText( actionButtonDescription, 1155 * sW, ( actionButtonHeight + 25 ) * sH, 20 * sW, 45 * sH, tocolor( 255, 255, 255, actionButtonAlpha ), 1, segoeSemiLight16 ) end addEventHandler( "onClientKey", root, function( button, state ) if button == actionButton[ 1 ] then if state == true then action_image = "files/btn_unactive.png" else action_image = "files/btn_active.png" end end end) Solved, xd - that was my problem. I didn't figure out that actionButton[ 1 ] is "E" and not "e". That's why my code couldn't read it correctly. Thank you! 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