Here's another variation, similar to Pekka's.  To use this, you need 
to assign a number of sprites (1 for each digit) each with a zero 
pixel or one pixel cast member in them.  Then, have cast members 
representing the digits, "Digit0", "Digit1", "Digit2"... "Digit9", 
and "Digit " (for blank character padding at the left).  This is 
completely untested, but should be close to working:

on DisplayScore score
   channelOffset = ??  --  one before the channels used for the score
                                  -- For example, if you assign 
channels 40 throu 43, this should be 39
   maxDigits = 4  -- or however many digits your maximum is
   scoreAsString = string(score)

   -- Left pad with blanks
   repeat while (length(scoreAsString) < maxDigits)
     put " " before scoreAsString
   end repeat

   -- Now show the appropriate digit bitmaps in the appropriate channels
   repeat with i =1 to maxDigits
      spriteChannel = channelOffset + i
      thisDigit = char i of scoreAsString
      thisDigitMemberName = "Digit" & thisDigit
      sprite(spriteChannel).member = thisDigitMemberName
   end repeat
end


Another completely different approach would be to have one sprite, 
and use Imaging Lingo to build up a bitmap of the score on the fly. 
I'll leave that code up to you ...

Irv


>
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
>Robert Knepher
>Sent: 27. kes�kuuta 2001 4:09
>To: [EMAIL PROTECTED]
>Subject: <lingo-l> Bitmap Numbers
>
>
>hi list,  I am lost.  I am working on a game that has score figured as a
>global and put into a field with lingo.  Now I am to change this to the
>artists bitmap numbers.  I hope this makes sense.  Any help is greatly
>appreciated. thanks, robert
>

-- 

Lingo / Director / Shockwave development for all occasions. 
          
   (Home-made Lingo cooked up fresh every day just for you.)

[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