9/04/2012

Fade Orthello sprites from solid to transparent

Todays task seems to be fairly simple: I want to put a logo sprite at the beginning of level one and fade it out as soon as the game starts. Placing the sprite is not a problem but finding the way to adapt transparency using Orthello is not straight forward... at least if you do not bother reading the manual :)

My first guess to grab and slide the "Alpha" property produced a warning:
Orthello: Alpha value can not be set on this materialReference!
Sprite material properties
Unfortunately googling for "Orthello materialReference" did not (obviously) produce any useful result. Just the well known "Did you mean: othello ...".


Note to self: Never name anything within the reach of one Levenshtein distance of any popular word if you do not want to loose customers due to Googles suggestions.

Ok, then I'll trial and error my way towards success:
  • Unticking the "transparent" checkbox → Ugly black borders where the transparent sprite sections used to be
  • Ticking the "Additive" checkbox → Sprite color is added on top of background color
  • Changing the "Tint Color" → Another warning
Finally replacing "Material Reference" transparent with the word alpha did do the trick. As I found out afterwards, there is a quite good explanation on the first page of Orthellos manual which also happened to be the second google hit above...

Lessons learned: RTFM (at least page one) even if it's late in the evening!

In short: There are named material references which can be assigned to any sprite. It's also possible to define your own material reference. The one named "alpha" modifies the sprites transparency according to the "Alpha" setting as well as the color tint according to the defined "Tint Color". I left the tint color blank, i.e. used a medium gray, and was now happily able to fade my sprite in and out using the "Alpha" slider.

Creating the script to do the fading was no real problem compared to understanding the property handling:

No comments:

Post a Comment