Use toBitmapData.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@721 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -22,15 +22,8 @@ public class SimpleIconButton extends SimpleButton
|
|||||||
*/
|
*/
|
||||||
public function SimpleIconButton (icon :*)
|
public function SimpleIconButton (icon :*)
|
||||||
{
|
{
|
||||||
var bmp :BitmapData;
|
var bmp :BitmapData = ImageUtil.toBitmapData(icon);
|
||||||
if (icon is Class) {
|
if (bmp == null) {
|
||||||
icon = new (Class(icon))();
|
|
||||||
}
|
|
||||||
if (icon is BitmapData ) {
|
|
||||||
bmp = BitmapData(icon);
|
|
||||||
} else if (icon is Bitmap) {
|
|
||||||
bmp = Bitmap(icon).bitmapData;
|
|
||||||
} else {
|
|
||||||
throw new Error("Unknown icon spec: must be a Bitmap or BitmapData, or a Class " +
|
throw new Error("Unknown icon spec: must be a Bitmap or BitmapData, or a Class " +
|
||||||
"that becomes one.");
|
"that becomes one.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user