Archive for the 'Wii' Category

WiiSizing Text Class

So any of you out there that have played with a Nintendo Wii yet—or more specifically run out of energy bowling all night and decided to look at the news reader built into it—will have probably been pretty impressed with the dynamic nature of the interface elements. This class allows users to resize text in a fun and smooth way, and does the text resizing on a string within the confines set by you. So there optionally is a max size set by a defined bounding box.


(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)
It requires Tweener at the moment, but i plan on refactoring it to allow you to pass the tweening in your preferred class (though promoting the use of Tweener isn’t a bad thing in my opinion).

How to instantiate and use the class

// import the class
import com.paperclipped.text.TextResizer;
// make an new instance of it 'this' refers to the stage in this example, but could be any DisplayObject.
var myResizer:TextResizer = new TextResizer("all the words i really wanted to deal with at the moment", this, {t:0, r:stage.stageWidth, b:stage.stageHeight, l:0});
// to change the size of the text, +/- change in point size, easing style, speed, and optionally a delay for a ripple effect
myResizer.resizeText(6, 'easeoutquad' ,0.5, 0.08);

It’s pretty short and simple but a neat ‘discovery’ for your users when the need a closer look at some text that was spec’d a little too small for them Download the TextResizer Source. There are also settings for tracking [letterSpacing across the whole string] and wordspacing that can be optionally defined. And if you just need to resize the text and have it bounce down instantly you can leave out the time, or easing type parts and just use: