IPhone Text Glow Effect

As of 3.2 you there is direct support for shadows in the SDK. label.layer.shadowColor = [label.textColor CGColor]; label.layer.shadowOffset = CGSizeMake(0.0, 0.0); Play with the parameters: label.layer.shadowRadius = 3.0; label.layer.shadowOpacity = 0.5; And to avoid shadow being clipped by the label bouds: label.layer.masksToBounds = NO; Don’t forget to #include <Quartzcore/Quartzcore.h> and link against the QuartzCore or … Read more

How to show animated image from PNG image using javascript? [ like gmail ]

I leave you a rough example so you can get a starting point: I will use a simple div element, with the width and height that the animated image will have, the png sprite as background-image and background-repeat set to no-repeat CSS Needed: #anim { width: 14px; height: 14px; background-image: url(https://ssl.gstatic.com/ui/v1/icons/mail/im/emotisprites/wink2.png); background-repeat: no-repeat; } Markup … Read more

how to use a swing timer to start/stop animation

import javax.swing.Timer; Add an attribute; Timer timer; boolean b; // for starting and stoping animation Add the following code to frame’s constructor. timer = new Timer(100, new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { // change polygon data // … repaint(); } }); Override paint(Graphics g) and draw polygon from the data that was … Read more

A non-nested animation sequence in jQuery?

You can make a custom .queue() to avoid the limitless nesting.. var q = $({}); function animToQueue(theQueue, selector, animationprops) { theQueue.queue(function(next) { $(selector).animate(animationprops, next); }); } // usage animToQueue(q, ‘#first’, {width: ‘+=100’}); animToQueue(q, ‘#second’, {height: ‘+=100’}); animToQueue(q, ‘#second’, {width: ‘-=50’}); animToQueue(q, ‘#first’, {height: ‘-=50’}); Demo at http://jsfiddle.net/gaby/qDbRm/2/ If, on the other hand, you want to … Read more

Why isn’t TextBox.Text in WPF animatable?

Trying to animate the TextBox manually …. var timeline = new StringAnimationUsingKeyFrames(); timeline.KeyFrames.Add(new DiscreteStringKeyFrame(“Goodbye”, KeyTime.FromTimeSpan(new TimeSpan(0,0,1)))); textControl.BeginAnimation(TextBox.TextProperty, timeline); …reveals a more useful error message. The last line fails with the following ArgumentException: ‘Text’ property is not animatable on ‘System.Windows.Controls.TextBox’ class because the IsAnimationProhibited flag has been set on the UIPropertyMetadata used to associate the property … Read more