Page 1 of 1

Use brushes by name instead of number.

Posted: Sun Jul 05, 2015 2:01 pm
by Bugala
If you have many brushes, it starts to become difficult to remember what exactly was the number of some specific brush, hence it is many times easier to refer to them by names, as example, instead of displaying brush 2, you would be displaying brush "dog".

small example:

Code: Select all

@BRUSH 1, "picture1.iff"
@BRUSH 2, "picture2.iff"
@BRUSH 3, "picture3.iff"

t_brushes = {
            [1] = "cat",
            [2] = "dog",
            [3] = "pig"
                 }

DisplayBrush(t_brushes["dog"], x, y)

Re: Use brushes by name instead of number.

Posted: Mon Jul 06, 2015 9:28 am
by djrikki
Personally I prefer to use a list of Constants for this kind of convenience. Ideally I would like to use Enums so dont have to worry about sorting Numbers, but Hollywood doesn't have such a command.

Re: Use brushes by name instead of number.

Posted: Tue Jul 07, 2015 12:27 am
by airsoftsoftwair
@djrikki: You could file a feature request for enum in Hollywood :)

Re: Use brushes by name instead of number.

Posted: Tue Jul 07, 2015 2:13 pm
by djrikki
I thought about it... then I realised you would probably see my post above :lol: