Forums > MaxMSP

lcd and "clear"

February 20, 2009 | 7:12 am

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.


February 20, 2009 | 7:38 am

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


February 20, 2009 | 3:43 pm

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
>


February 22, 2009 | 9:13 am

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


February 22, 2009 | 6:29 pm

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…


February 22, 2009 | 9:21 pm

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


February 23, 2009 | 1:20 pm

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


February 23, 2009 | 8:55 pm

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


February 23, 2009 | 10:11 pm

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.


February 23, 2009 | 11:01 pm

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

February 28, 2009 | 10:44 am

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.


Viewing 11 posts - 1 through 11 (of 11 total)