Scrolling 1 & 2 Column Movie Credits

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Hutchboy
Posts: 51
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Scrolling 1 & 2 Column Movie Credits

Post by Hutchboy » Thu Feb 08, 2024 1:18 am

Hi,

I'm uploading a small stack that demonstrates a scrolling "movie credits" animation that I am using in one of my projects. The first card displays a 1 column scroll and the second a 2 column scroll. There is a scrollbar on each card to dynamically change the scrolling speed. The only change I am trying to make is to have the scrolling begin above the bottom of the screen so it doesn't interfere with the buttons. It isn't a problem on the 1st card but it is on the second card.

See the card script headers for more info. -Mike
Attachments
MGB Scrolling Credits Animation.livecode.zip
(5.79 KiB) Downloaded 21 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Scrolling 1 & 2 Column Movie Credits

Post by bn » Thu Feb 08, 2024 10:30 am

Hi Mike,

That looks very nice and runs smoothly.

I added a fade to the top fields before deleting them to handler "startScroll" of card 1

Code: Select all

on startScroll
   local tNumFields, i, tFieldBottom, tScrollSpeed
   local tBottomTop
   put the bottom of button "Scrolling Credits - 1 Column" into tBottomTop
   
   repeat while sContinueScrolling
      lock screen
      -- Adjust scrolling speed based on the thumbPosition of the scrollbar
      -- Assuming scrollSpeedBar's thumbPosition ranges from 0 to 100
      put the thumbPosition of scrollbar "scrollSpeedBar" into tScrollSpeed
      -- Map the thumbPosition to a meaningful scroll speed value
      -- Here we convert a range of 0-100 to 1-10 milliseconds wait time
      put 10 - (tScrollSpeed / 10) into tScrollSpeed
      
      wait tScrollSpeed milliseconds with messages
      put the number of fields into tNumFields
      
      if tNumFields = 0 then
         exit repeat
      end if
      
      repeat with i = tNumFields down to 1
         set the top of field i to (the top of field i - 1)
         put the bottom of field i - tBottomTop into tFieldBottom
         -- Delete fields as they scroll past a certain point (e.g., 0 pixels from the top of the card)
         if tFieldBottom <=100 then
            if tFieldBottom < 0 then
               delete field i
            else
               set the blendlevel of field i to 100 - tFieldBottom
            end if
         end if
      end repeat
      unlock screen
   end repeat
end startScroll
Kind regards
Bernd

Post Reply

Return to “Games”