Page 1 of 1
Making a hue-shifting slider [Solved]
Posted: Mon Dec 01, 2014 10:46 am
by SundownKid
I am trying to make a slider where you can have a base image (of hair, for instance) and select hair color of a character using the slider to customize the character. There would be 3 sliders, Red, Green and Blue, which would change the amount of said color in the hair in real time as you moved the slider. So, how is it possible to do that in real time? Does it have something to do with the hue shifting functionality?
Re: Making a hue-shifting slider
Posted: Mon Dec 01, 2014 11:09 am
by nyaatrap
DynamicDisplayable(im.matrix.tint(value_changed_by_screen_slider_1, ....)) might be possible, but it must have huge disadvantage on performance. I don't know it's practically bearable to play a game. Currently, there's no way to change colors with hardware acceleration.
Re: Making a hue-shifting slider
Posted: Mon Dec 01, 2014 2:49 pm
by SundownKid
That is interesting. Well, I will try the dynamic version to see if it works, otherwise simply have a number of selectable colors instead.
P.S. Maybe you could put a code sample of being used with, say, "test.png"? I still don't quite understand how the code would be formatted.
Re: Making a hue-shifting slider
Posted: Mon Dec 01, 2014 9:26 pm
by nyaatrap
Code: Select all
def render_image(st,at,char):
return im.MatrixColor(char, im.matrix.tint(r, g, b)), .1 #re-render in 0.1 seconds. try .5 if performance is poor.
image girl = DynamicDisplayable(render_image, char="girl.png")
Code is something like the above. I didn't test it, but if you make a screen which changes variables: r, g, b, then it'll work.
Re: Making a hue-shifting slider [Solved]
Posted: Fri Dec 12, 2014 10:24 pm
by SundownKid
Well the top part had to be put in an 'init python' block but otherwise it worked fine. It seems to be working albeit with some slight lag but that's better than nothing. Thanks!