Page 1 of 1

How to make flashing Chili objects

Posted: 28 Aug 2015, 19:30
by Silentwings
Split from viewtopic.php?f=14&t=33829
whole tech window flash but I didn't know how to code that easy and fast while using chili
I didn't look at the game (away from home and not able to atm), so maybe I'm about to answer the wrong question - but you can put a constant colour image as a Chili image in as the first child of the object and then (repeatedly) alter that images colour/transparency setting. Or, if your Chili theme has a background already for the object, a simple solution is to just keep changing Object.backgroundColor and Object.borderColor.

Re: Ludum Dare 33

Posted: 28 Aug 2015, 19:56
by gajop
Silentwings wrote:I didn't look at the game (away from home and not able to atm), so maybe I'm about to answer the wrong question - but you can put a constant colour image as a Chili image in as the first child of the object and then (repeatedly) alter that images colour/transparency setting. Or, if your Chili theme has a background already for the object, a simple solution is to just keep changing Object.backgroundColor and Object.borderColor.
Oh, you can do that for images as well? I thought they used textures which ignored color settings.

Ludum Dare 33

Posted: 28 Aug 2015, 23:32
by Silentwings
Oh, you can do that for images as well?
Yep! All the unit pics in BAR, the colour is actually added by chili.

Re: Ludum Dare 33

Posted: 29 Aug 2015, 00:08
by gajop
Silentwings wrote:
Oh, you can do that for images as well?
Yep! All the unit pics in BAR, the colour is actually added by chili.
Ah you're right. I think I tried .backgroundColor and didn't look further. It seems it's only multiplied with the texture though so you can't add colors (e.g. can't turn a blue image red), but you can still do a lot if the image is white.

Re: Ludum Dare 33

Posted: 29 Aug 2015, 03:23
by jK
gajop wrote:Unlock available should just make the whole tech window flash but I didn't know how to code that easy and fast while using chili. (Probably would have to resort to default opengl and had no time for that)
There is an example in the demo widget.

Re: Ludum Dare 33

Posted: 29 Aug 2015, 03:39
by gajop
jK wrote:
gajop wrote:Unlock available should just make the whole tech window flash but I didn't know how to code that easy and fast while using chili. (Probably would have to resort to default opengl and had no time for that)
There is an example in the demo widget.
Yep! I've been using that for buttons, text and similar for ages, I just didn't know there was the .color field for images.
I'm keep to restart work in chili fx for some sexier animated UI though -> shaders would probably be neat.