lcd and "clear"

Feb 20, 2009 at 7:12am

lcd and "clear"

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.

#42415
Feb 20, 2009 at 7:38am

I suppose you could just draw a rectangle at those coordinates that’s the same color as your background…

#151826
Feb 20, 2009 at 3:43pm

why not just send a paintrect message with a color that matches your
background over the area in question?

M

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.
>
>
> –
> 010001000010110101001011
>

#151827
Feb 22, 2009 at 9:13am

The main issue is that I have another picture for my background so it is not possible to cover it with a rectangle.

#151828
Feb 22, 2009 at 6:29pm

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…

#151829
Feb 22, 2009 at 9:21pm

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.
T

#151830
Feb 23, 2009 at 1:20pm

before clearing a region, first create a region.

(“region” actually exist in lcd world)

but i would recommend the draw-a-rect-in-backgroundcolor method.

-110

#151831
Feb 23, 2009 at 8:55pm

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.

thanks for the replies Smile

#151832
Feb 23, 2009 at 10:11pm

for text, try textbrick:
http://www.loadbang.net/space/Software/TextBrick

you could have the textbrick ui object(s) used for text overlaid on top of the lcd object which just draws and hides sprites or regions.

#151833
Feb 23, 2009 at 11:01pm

Re: sprites and ‘write’ messages, there is an issue where you need to make sure that you define the font AFTER the ‘recordsprite’ message:

– Pasted Max Patch, click to expand. –
#151834
Feb 28, 2009 at 10:44am

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.

Thank you all.

#151835

You must be logged in to reply to this topic.