help with speedy graphics

Scott Rossi scott at tactilemedia.com
Tue Jul 13 21:42:56 EDT 2004


Recently, "Richard Gaskin" wrote:

>>>> The script (see below) uses (tries to use) templateGraphic to set the
>>>> size and colour, but this doesn't seem to have any effect.  It also
>>>> uses lockscreen - but I see each rectangle being drawn one-by-one - I
>>>> had expected that with lockscreen set, I would see nothing until all
>>>> the rectangles were drawn and lockscreen was set false again.
>>> 
>>> 
>>> It may be the IDE getting in the way, adjusting those properties on
>>> newGraphic.  Adding "lock messages" before the loop seems to take care
>>> of it.
>>> As for the lockscreen issue, I believe that's a known bug in the IDE;
>>> you should not see that in a standalone or if the IDE is suspended.
>> 
>> 
>> Cool - thanks.
>> Adding the lock messages made this script OK - all the rectangles appear
>> at the same time; but the clean-up script that deletes all these
>> graphics when I'm done with them is problematic, even with lock screen
>> and lock messages. Suspending the dev tools makes it faster - but it
>> still does the rectangles one at a time.
>> 
>> But even with this improvement, it's un-usably slow.
> 
> It's pretty fast here, but I'm using a different IDE.
> 
> But here's a tip I got from Geoff Canyon:  you could use one polygon
> object, setting the points in script.  If you have blank lines in a set
> of polygon points the resulting object will have discontiguous regions.

This won't work if the desired goal is to be able to colorize the graphics
with different colors.  Using a single polygon will be just that: a single
polygon that is only capable of being drawn in one color at a time.

IMO, 5 to 10,000 objects is a lot -- maybe too many to be manipulated
quickly on all but the fastest systems.  Is there some way you could reduce
the number of graphics, or look at a different way to construct your
representation?

Regards,

Scott Rossi
Creative Director
Tactile Media, Development & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com



More information about the use-livecode mailing list