@altilim, could the setColorTransform() function support the HSV model as well as the RGB model?
I want to affect the hue without changing the saturation or value, and the RCB approach doesn't support it. It just tints the overall image. Changing hue allows the grays (equal r,b,g proportions) to go untouched while changing the non-grays.
Comments
I've dealt with HSL recently, here's the code I used (just ported it to Gideros, didn't test thoroughly, but seems to work):
can't you retrieve RGB using :getColorTransform() or use a default RGB value,
convert it to HSL,
modify hue,
convert back to RGB,
and use setColorTransform() to set new RGB values?
While what you are suggesting sounds fine on the surface, but it won't work the way it is intended to.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
After reading your posts (mainly @techdojo's post), I tried to implemented a simple example that displays an image with changing HSV values.
First I created 3 images by shifting their rgb channels:
1st image -> r, g, b
2nd image -> g, b, r
3rd image -> b, r, g
Then I calculated the 3x3 color transform matrix from HSV values and apply these values to these images by using setColorTransform and then render them with additive blending.
On the other hand, it seems it's not a practical way to be used in a real application.
(edit: I take the matrix from here: http://beesbuzz.biz/code/hsv_color_transforms.php)
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
@OZapps, to get what you want, then I would overlay the "non modifiable" colors on the final shifted image. In this examples, the skin may be a pink color regardless of the uniform choices the user makes.
Just create all of your graphics you want to colour in a white / greyscale and then apply the RGB tinting only to that layer - it'll give you the same effect. Your adding the "pink" faces on later anyway.
When "render to texture" becomes available you could replicate this process before the game starts and then just have a single sprite sheet to use.
Just my $0.02
Likes: atilim
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
DOH!!! Ninja'd by techdojo (
Likes: atilim
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Likes: techdojo
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Fragmenter - animated loop machine and IKONOMIKON - the memory game
still, it would be more convenient to work with bitmaps (media is not a bitmap, or is it? there is no freely available documentation for it and in the labs topic i did not find if it inherits from any class) especially that media is in experimental stage, so i'm still interested if opengl2 might bring this feature.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Currently without @atilim's consult I can not confirm nor deny the possibility of feature being supported in OpenGL 2.0
But I will check with him
thanks for checking the opengl2 part.
Fragmenter - animated loop machine and IKONOMIKON - the memory game