TextScroll: Week 5, July 6 – Michelle

Modifying MarqueeLabel is giving me a hard time. I noticed that its pause and unpause methods were changing the speed mid-animation, so I tried writing a dynamic setSpeed function based off those two methods. This didn’t work, so Prof. Medero offered some links where people were able to adjust the speed of objects mid-animation. I first tried placing this code into MarqueeLabel, but nothing would happen when I called it. I suspect that I either didn’t translate it properly from C# to Swift, or something else in MarqueeLabel was overwriting this function’s commands. Another tutorial shows you how control an animation using the slider. This method excites me because once I have the animation loaded in a variable, it’s very easy to go backwards and forwards without any complex code: animation.offset += tilt. However, programming the animation and saving it in an accessible variable is giving me a hard time at the moment. MarqueeLabel does some very complex setup since it’s juggling multiple animation options and an optional gradient mask, so I haven’t been able to extract the precise lines I need to just animate a nongradient strip of text moving to the right. I bounced back and forth between adding to the complex MarqueeLabel or making my own simplified version of it with just a body of text inside and rightward scrolling. I’m currently leaning towards making my own. Based on this, all I’ve got in my simple version is a UILabel inside a ScrollView and haven’t figured out how to get the animation inside a variable like the slider tutorial does. I’ll continue messing with it tomorrow…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s