At 10:03 +0100 01/28/2002, Natalia Tjelum wrote:

>Hey
>
>Number 5:
>sprite(1).color = rgb(random(1,255), random(1,255), random(1,255))
>This way you get a random number between 1 and 255.

Actually random(255) and random (1, 255) mean the same thing. Unless 
you explicitly say otherwise, the lowest possible number in the range 
defaults to 1.

Still it would make more sense to do random(256) - 1, since RGB is 0 
to 255, not 1 to 255.


>Tom Hines
>Sent: 28. januar 2002 06:20

>1) If a vector/shape member is filled/stroked a certain colour with the
>foreground/background colour chips, will that member colour always display
>the
>same on another computer/platform?

It should, or at least a reasonable approximation thereof. For 
something like that you might want to test, of course.

>2) If a vector/shape member or bitmap sprite's colour is set via lingo, will
>the choosen colour be the same on all computers/platforms? (especially
>when using paletteIndex()

No, not when using paletteIndex. The only way for *that* to work is 
to set your movie's palette to Web216. Doing otherwise will result in 
your file probably using whatever palette is resident on a given 
machine, and thus yielding unpredictable results. You're going to be 
happier with RGB for 16-bit and above, and always use Web216 if 
you're constraining to 8 bit.

>3) Will using rgb() opposed to paletteIndex() always display the intended
>colour as the same on all computers/platforms?

Depends on the color depoth of the system. See above.

>4) If an 8-bit member is displayed on a 16-bit or higher colour-depth
>monitor will the member display in its correct colours if the 8-bit palette
>it
>conforms to is not used? (ie. since the monitor obviously has enough colours
>available to match the intended member colours)

It *should*, yes.

>5) I'm also having problems with setting a bitmap sprite to a random colour
>repeatedly via lingo.
>Using either of the following two statements only seems to change the
>sprite's colour to varying shades of the same colour.
>
>sprite(1).color = rgb(random(255), random(255), random(255))
>
>sprite(1).color = paletteIndex(random(255))

Setting the color on a sprite that has more than 1 bit color depthj 
gives you a color wash or colorization, which is what you are seeing, 
rather than filling it with a solid version of that color.

In order for color setting of this type to work predictably, your 
sprite's bitmap member must be at 1-bit color depth.

-- 

              Warren Ockrassa | http://www.nightwares.com/
  Director help | Free files | Sample chapters | Freelance | Consulting
        Author | Director 8.5 Shockwave Studio: A Beginner's Guide
                    Published by Osborne/McGraw-Hill
          http://www.osborne.com/indexes/beginners_guides.shtml
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/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