why not just send a paintrect message with a color that matches your
background over the area in question?
On Feb 20, 2009, at 2:12 AM, Dunya Kirkali wrote:
> Dear All,
> Is it possible to clear only a given region of an lcd object?
> For example one could send a "clear 10 10 50 50" (left, top, bottom,
> right) and clear the contents of just that rectangle.
Well, it's not possible to clear just a portion of LCD, and if it was, then it would probably clear that part of your picture as well. What exactly are you trying to do? if you only have to clear a certain area every so often, you could just redraw the LCD entirely, leaving out the part you want gone...
You can make the lcd background transparent (in inspector) then use sprites to do all your drawing. Then use the hidesprite and drawsprite messages when you want to cover/uncover areas of your background.
I tried the sprite approach. But I couldn't get the sprite to record text "write" messages. Don't know why yet.
I have a fpic as a background image on top of which I draw a matrix of pictures in the lcd. I want to be able to redraw any one element of the matrix so that I don't have to redraw the whole matrix (since it takes some time...).
So I need to clear that region in order to make it transparent again so that I can see my fpic through the lcd.
I couldn't figure out the region approach yet. I will have a look into it soon.
I appreciate all the help.
I tried textbrick, it looks nice but it is a limited for what I am thinking of.
I also tried the sprite approach (thanks to ben I got the text to work in the sprites too). It seems to work fine. But once I want to have dynamic user interfaces with a lot of sprites in it, it still taqkes some time to hide/show sprites. It might still be because of the "write" command ("see lcd and write method" in the forum)but I haven't tested it any further.