Updating a Icon's Color WIth Values From Interface Bars in Developer Help
|
|
Code:
obj demo icon = 'blank.dmi'
mob var obj/color r g b
Stat() if(src.color) CPick()
Login() src.color = new /obj/demo
proc CPick() src.r = round(255 * text2num(winget(src, "rgb.bar1","value")) / 100) src.g = round(255 * text2num(winget(src, "rgb.bar2","value")) / 100) src.b = round(255 * text2num(winget(src, "rgb.bar3","value")) / 100) src.color.icon = 'icon.dmi' + rgb(src.r,src.g,src.b) winset(src,"rgb.red", "text= [src.r]") winset(src,"rgb.green", "text=[src.g]") winset(src,"rgb.blue", "text=[src.b]") winset(src,"rgb.image", "image=[src.color.icon]")
|
Problem description: What I'm attempting to do is allow players to adjust 3 slide bars in order to change RGB values and allow a preview of the color, but what actually happens is the initial color of black is shown, while others are not as the bars are adjusted; the space where the image should be appears blank.
|