Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Show a sprite being hit like in the arcades. - Gideros Forum

Show a sprite being hit like in the arcades.

Ok, so sometimes you shouldn't believe everything you read.

For example, in the Gideros instructions it says that the setColorTransform command takes parameters from the value 0 to 1. That's kinda not true.

But, it's a useful 'not true' as it means you can add a nice effect used in arcade games for when a sprite gets hit. In an arcade game they usually flash white.

Normally you would have to have a white 'mask' of the sprite or do some fancy shader coding, but in reality you don't because the setColorTransform limit is actually not 1...

Here is my game sprite:

Here is code that has a much higher than 'valid' value for the setColorTransform...

Want to make it red instead? ...

So, it's that easy! After a frame just set the transform back to normal (1,1,1) and the original colours will be restored.
530 x 325 - 123K
673 x 479 - 169K
693 x 547 - 199K
+1 -1 (+4 / -0 ) Share on Facebook


Sign In or Register to comment.