Any way to colorize sprites?
Monkey Forums/Monkey Programming/Any way to colorize sprites?
| ||
Often when doing special effects, I colorize a sprite-- for instance, I might have a pure white graphic of a spark, and I set things up so that it actually draws red (or the color of my choice). Any way to do that in Monkey? Or will I have to store redundant graphics? (And if that's the case... how to do a nice smooth fade from orange to red to black to do smoke?) Wasn't sure if that was cross-compatible with Flash or HTML or not, and thus wouldn't be in there. |
| ||
You answered your own question. It's not compatible with all targets, hence unlikely to become part of the core Monkey language... which is a bummer. |
| ||
Fie... it looks like HTML5 is the odd man out... this is such an incredibly important gaming feature, that doesn't it seem reasonable to put it in and let HTML5 be the exception? Perhaps someone could write some C++, XNA, and Flash importing code that could be used? Again, this is a *very* important feature. I've been writing games professionally for ten years now, and I have used this in every single one of them since the beginning. Leaving this out limits the special effect capacity of a game *tremendously.* |
| ||
I suspect module-makers will enable it for various specific targets, even if it never makes into the core of Monkey. At least that's what I'm hoping. |
| ||
Having Monkey export to HTML5 is cool and fun, but it is just a toy ATM. So I think having SetColor work with images for other targets is a must. |
| ||
SetColor is definitely missing badly. In the long run i would welcome a concept where there are features which work on all platforms and features which are only working on certain platforms (beeing marked in the docs according to their supported platforms) as otherwise you will end up with the annoyances of the least common denominator. This only works out if all platforms aren't too far away from each other, otherwise it can be a real drag. |
| ||
I agree! Making targets with commercial potential suffer because of some with no commercial potential is a bad idea. (Im looking at you javascript) |
| ||
Well HTML5 can do quite everything, the problem is the speed in doing this Here someone suggest to change the color of an image making a copy of it and drawing on it with another color, than 'grabbing' it. But sure this is not as fast as an OpenGL call. Here another solution: in this case the 'pixmap' (getImageData) is manipulated directly to change its component. Still the problem - presume - is the speed. Cheers ps: with getImageData it should be possible to implement Write/Read pixel... |
| ||
WebGL is part of HTML5, but I don't know how to enable it with Monkey. |
| ||
Here someone has done a wrapper for monkey based on WebGL. Maybe you can get inspiration! |
| ||
@degac Well, speed somehow can be everything. If it's not fast enough, it just isn't an option. |
| ||
Ok, but you can always 'prepare' before run the resources: you download one image, then you colorize it before playing the game... |
| ||
The WebGL demo is really interesting. I think next I will do a Monkey Target Installer, which adds the GLFWMINGW and WEBGL target, and later on more. The Target Installer would work with any Monkey version, because it only patches some Monkey files. One big benefit of the WEBGL target would be that it is the fastest to compile, so it would be a good quick test tool when writing code and testing it. Currently HTML5 is the fastest to compile, but since it is so slow and lacks features, WEBGL would be better. |
| ||
I think that having this is a must. Hopefully Mark will listen to us. |
| ||
I'm pretty sure Mark intends to add this sooner rather than later. |
| ||
Yep, this will be useful for particle systems in particular :) |