Fandom

Scratchpad

Tutorial: Scrolling Track Titles

215,965pages on
this wiki
Add New Page
Discuss this page0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Tutorial: Scrolling Track Titles at Wikia


Welcome to the Tutorial: Scrolling Track Titles mini wiki at Scratchpad!

You can use the box below to create new pages for this mini-wiki. Make sure you type [[Category:Tutorial: Scrolling Track Titles]] on the page before you save it to make it part of the Tutorial: Scrolling Track Titles wiki (preload can be enabled to automate this task, by clicking this link and saving that page. Afterwards, you may need to purge this page, if you still see this message).

In process of making a "minimalist" theme.. had the idea to put the currently playing track on screen.. but some titles were too long.. So I decided to attempt something I've never done before! A scrolling display! How was it done? Read on...

1. Make a base image i.e. Mp3ClipBG
2. Make a 2nd image i.e. Mp3ClipBG2
3. Make a text object and assign it the DXPlayer ability - Clip Name

4. Parent the 2nd image to the base image
5. Parent the text object to the 2nd image
6. Get exact width of 2nd image (in this case it's 238 pixels)
7. Insert the following code into your text object:

'Called when the script is executed
Sub Object_OnScriptEnter
Object.SetTimer 1, 1
Object.Left = 2 'Aligns the text object 2pixels in from parent image
End Sub
<p> Sub Object_OnTimer1
If Object.Left + Object.Width <= 236 Then ' Checks when the end of text is lined up with right edge of parent image - 2
Object.SetTimer 4, 2500 ' Pause timer
Object.KillTimer 1
Else
Object.Left = Object.Left - 1 ' if still not at right edge - carry on moving left
End If
End Sub
<p> Sub Object_OnTimer3
Object.SetTimer 1, 1
Object.KillTimer 3
End Sub
<p> Sub Object_OnTimer4
Object.SetTimer 2, 1
Object.KillTimer 4
End Sub
<p> Sub Object_OnTimer2
If Object.Left => 2 Then ' Checks the text is back at starting position, 2 pixels in from left edge of parent image
Object.SetTimer 3, 2500
Object.KillTimer 2
Else
Object.Left = Object.Left + 1
End If
End Sub
<p> 'Called when the script is terminated
Sub Object_OnScriptExit
Object.KillTimer 1
Object.KillTimer 2
Object.KillTimer 3
Object.KillTimer 4
End Sub

Also on Fandom

Random wikia