On 2005-12-31 01:50:09 +0000, Sarah Reichelt <sarah.reichelt- [EMAIL PROTECTED]> said:

I'm trying to draw a bar graph in Revolution using values from an
array.  I use the following code, repeated for each bar, to draw the
graph:

create invisible graphic
set the style of it to rectangle
set the opaque of it to true
set the rectangle of it to startY,tDrawX,tDrawY,startX
set the foregroundColor of it to "#000000"
set the backgroundColor of it to "#9198A0"
set the lineSize of it to 1
show it

This all works very well, but the next time I come to draw the graph,
the old rectangles are still sitting there. How can I get rid of them?


Have a loop at the start of your drawing routine that goes through and
deletes them all. If you have no other graphics, you can do:

   repeat the number of graphics times
        delete graphic 1
    end repeat

If you have other graphics that shouldn't be deleted, then I suggest
you name your chart graphics as they are made, and do something like
this:

    repeat with x = the number of graphics down to 1
if the short name of graphic x contains "Chart" then delete graphic x
    end repeat

HTH,
Sarah

Thanks very much for the very prompt reply Sarah :-) - I do have some other graphics so I'll need to go the second route.

Thanks again,

Karen
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to