Hi Kerry

See below: (rather dyslexic explaination but what the heck US english is my
3rd language)

> I'm getting a yellow flash on screen when I set the member of a sprite.
>
> First, I'm hiliting the text with this code:
>
>        pDotSprite.member.regpoint = point(0,0)
>        pDotSprite.member.image = hiliteImage
>        set pDotSprite.rect = targetRect
>
> Then when I want to move on, I use this code to remove the hilite:
>
>    pDotSprite.member.image.fill(rect(0, 0,
> pDotSprite.member.image.width,
> pDotSprite.member.image.height), rgb(255, 255, 255))
>    pDotSprite.member.image = kSaveDotImage
>    set pDotSprite.rect = rect(-1, -1, 0, 0)
>

First things, it is always better to do your image manipulations  outside of
the member vs inside the member.. less resource intensive. so lets look at
your situation, ignoring the first component because you say it works and I
believe you. But the second part could possibly be done a little better:

pDotSprite.member.image.fill(rect(0, 0,
pDotSprite.member.image.width,
pDotSprite.member.image.height), rgb(255, 255, 255))
pDotSprite.member.image = kSaveDotImage
set pDotSprite.rect = rect(-1, -1, 0, 0)

not 100% sure why you want to set the image of the member to a white block
(did I get the color right :-) before you swap out the images, wouldn't it
be better to simply swap the single dot image in, if not then I'd suggest
doing something like

l_ImgObj_TempImage - pDotSprite.member.image.duplicate()
l_ImgObj_TempImage.fill( l_ImgObj_TempImage.rect, rgb(255,255,255))
pDotSprite.member.image = l_ImgObj_TempImage.duplicate()
l_ImgObj_TempImage = VOID
pDotSprite.member.image = kSaveDotImage.duplicate()

but if you desire, you might get the same effect by just simply

pDotSprite.member.image = kSaveDotImage.duplicate()

however you still have your size issue, then assuming that you have set the
member to trimWhiteSpace

member("SomeBitmap").trimWhiteSpace = TRUE

then to get the member to redefine its own rect

pDotSprite.member.rect = pDotSprite.member.rect

also make director recognize the changes to the sprite

pDotSprite.rect = pDotSprite.member.rect

also, remember that sometimes with imaging lingo you have to give director a
kick in the a@# to remember that it needs to redraw the screen, which means
you have to literally tell it that everything on the screen is garbage and
that it needs to get its act together, in which case you simply issue:

the stagecolor = the stagecolor -- remember that this is a major performance
hit, use only if it actually fixes something otherwise discard this notion,
unless of course your using an LDM then this puppy is a basic requirment to
get the imaging lingo changes recognized.

Now one other assumption here, was kSavedDotImage a duplicate or a straight
reference to the image of the sprite, rationale question seeing that it
would stay connected to the image unless you unhooked it using duplicate()
in your original assignment.

Sincerely

Mark R. Jonkman


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to