Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 22 Apr 2010 20:39:48 +0200
Hello,
you can use LoadBrush( 1, "path to picture") but not LoadBrush( "pic_background", "path to picture")
in a large project (100 or more brushes), it is a lot easier to remember a name in your native language than just a number.
Is there some plan to change this?
Thanks.
[22 Apr 2010] Using text handlers instead of integers
[22 Apr 2010] Re: Using text handlers instead of integers
Note: This is an archived post that was originally sent to the Hollywood mailing list on 22 Apr 2010 22:10:31 +0200
Hi!
and than(for example)
You miss that Hollywood functionality? Or I missunderstand you question?
However I hope that helps!
Hi!
Why simply dont use the automatic id selection doing that:you can use LoadBrush( 1, "path to picture") but not LoadBrush( "pic_background", "path to picture")
in a large project (100 or more brushes), it is a lot easier to remember a name in your native language than just a number. Is there some plan to change this?
Code: Select all
MyNiceBrush = LoadBrush(Nil, "path to pic")
Code: Select all
DisplayBrush(MyNiceBruh, 0 ,0)
However I hope that helps!
Simone"Tuxedo"Monsignori, Perugia, ITALY.
[22 Apr 2010] Re: Using text handlers instead of integers
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 22 Apr 2010 23:15:16 +0200
Hello,
Hello,
Oh, I overlooked that one. It's a bit unusual to expect a return but that will do it. Thanks.MyNiceBrush = LoadBrush(Nil, "path to pic") DisplayBrush(MyNiceBruh, 0 ,0)
- TheMartian
- Posts: 109
- Joined: Sun Feb 28, 2010 12:51 pm
[23 Apr 2010] Re: Using text handlers instead of integers
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 23 Apr 2010 18:54:03 -0000
Hi
You can also get the best of both worlds by storing the indexes returned in a table using string indexes... something like this:
Then to manage your brush, just use myBrushes["Fred"] as the index for the brush. The nice thing is that ["Fred"] may also be a variable that is initalized to "Fred" or some other string. This often allows you to write a generic routine, that you can just feed with meaningfull names for your brushes.
regards Jesper
Hi
You can also get the best of both worlds by storing the indexes returned in a table using string indexes... something like this:
Code: Select all
myBrushes={}
myBrushes["Fred"]=LoadBrush(Nil,"path to pic")
regards Jesper
[24 Apr 2010] Re: Using text handlers instead of integers
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 24 Apr 2010 22:11:28 +0200
Hello,
Hello,
Ok but simple variables probably eat less memory than a tablemyBrushes["Fred"]=LoadBrush(Nil,"path to pic")
- TheMartian
- Posts: 109
- Joined: Sun Feb 28, 2010 12:51 pm
[25 Apr 2010] Re: Using text handlers instead of integers
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 25 Apr 2010 19:50:12 -0000
Hi
He he! I must admit to not being worried about the extra memory used to initialize a table. If I do something like:
... the start address of each table is different by $28. If this is an indication of the size of the basic table structure (I have to say I don't know if this is so.) I think it is a small price to pay compared to the advantages. Besides you only need one table to store pointers to your brushes and any brush will then be accessible by name with a command like:
...and allow you to do all the lovely things to your table that you can do to tables in general. I am primarily thinking about metatable tricks.
regards Jesper
Hi
He he! I must admit to not being worried about the extra memory used to initialize a table. If I do something like:
Code: Select all
t1={}
t2={}
t3={}
NPrint(t1,t2,t3)
Code: Select all
SaveBrush(MyBrushes[name$],"Ram:"..name$)
regards Jesper