off Posted January 3, 2014 Share Posted January 3, 2014 (edited) I want to change the color image in the script. Sorry for bad english. guiCreateStaticImage( 0, 0, 200, 200, "image.png", true ) Edited January 4, 2014 by Guest Link to comment
50p Posted January 3, 2014 Share Posted January 3, 2014 If you want to change the image color, you need to use dxDrawImage instead. Link to comment
Gallardo9944 Posted January 5, 2014 Share Posted January 5, 2014 local r,g,b = 255,255,255 -- Default is white function renderImage() dxDrawImage(100,100,200,200,"image.png",0,0,0,tocolor(r,g,b,255)) -- Draw your image end addEventHandler("onClientRender",getRootElement(),renderImage) -- Render it cause dx functions are drawn for 1 frame. function setColours(command,c1,c2,c3) c1 = tonumber(c1) -- We have strings by default, so try to make them numbers c2 = tonumber(c2) c3 = tonumber(c3) if not c1 or not c2 or not c3 then return end -- If some value can't be a number, then don't apply the changes r,g,b = c1,c2,c3 end addCommandHandler("color",setColours) /color 255 0 0 and it sets the image to be red. The code is untested though. 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