diff --git a/assets/helvetica-20-white.fnt b/assets/helvetica-20-white.fnt new file mode 100644 index 0000000..a65c749 --- /dev/null +++ b/assets/helvetica-20-white.fnt @@ -0,0 +1,99 @@ +info face="Helvetica Neue" size=20 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=0,0 +common lineHeight=24 base=20 scaleW=256 scaleH=128 pages=1 packed=0 +page id=0 file="helvetica-20-white.png" +chars count=95 +char id=32 x=22 y=42 width=0 height=0 xoffset=-2 yoffset=20 xadvance=6 page=0 chnl=0 +char id=33 x=194 y=76 width=6 height=18 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=34 x=244 y=38 width=8 height=10 xoffset=0 yoffset=4 xadvance=10 page=0 chnl=0 +char id=35 x=162 y=38 width=12 height=16 xoffset=-1 yoffset=6 xadvance=12 page=0 chnl=0 +char id=36 x=26 y=2 width=14 height=22 xoffset=-2 yoffset=2 xadvance=12 page=0 chnl=0 +char id=37 x=2 y=22 width=20 height=18 xoffset=0 yoffset=4 xadvance=20 page=0 chnl=0 +char id=38 x=78 y=42 width=16 height=18 xoffset=-1 yoffset=4 xadvance=14 page=0 chnl=0 +char id=39 x=194 y=108 width=6 height=10 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=40 x=176 y=62 width=8 height=22 xoffset=0 yoffset=3 xadvance=6 page=0 chnl=0 +char id=41 x=176 y=38 width=8 height=22 xoffset=-2 yoffset=3 xadvance=6 page=0 chnl=0 +char id=42 x=224 y=38 width=10 height=10 xoffset=-1 yoffset=4 xadvance=9 page=0 chnl=0 +char id=43 x=178 y=22 width=14 height=14 xoffset=-1 yoffset=8 xadvance=12 page=0 chnl=0 +char id=44 x=194 y=96 width=6 height=10 xoffset=0 yoffset=15 xadvance=6 page=0 chnl=0 +char id=45 x=202 y=56 width=10 height=6 xoffset=0 yoffset=11 xadvance=9 page=0 chnl=0 +char id=46 x=224 y=56 width=6 height=6 xoffset=0 yoffset=16 xadvance=6 page=0 chnl=0 +char id=47 x=162 y=56 width=10 height=18 xoffset=-2 yoffset=4 xadvance=8 page=0 chnl=0 +char id=48 x=134 y=2 width=14 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=49 x=198 y=38 width=10 height=16 xoffset=0 yoffset=6 xadvance=12 page=0 chnl=0 +char id=50 x=118 y=102 width=14 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=51 x=118 y=82 width=14 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=52 x=166 y=2 width=14 height=16 xoffset=-1 yoffset=6 xadvance=12 page=0 chnl=0 +char id=53 x=118 y=62 width=14 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=54 x=118 y=42 width=14 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=55 x=240 y=2 width=12 height=16 xoffset=-1 yoffset=6 xadvance=12 page=0 chnl=0 +char id=56 x=118 y=22 width=14 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=57 x=118 y=2 width=14 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=58 x=236 y=38 width=6 height=14 xoffset=0 yoffset=8 xadvance=6 page=0 chnl=0 +char id=59 x=176 y=108 width=6 height=16 xoffset=0 yoffset=9 xadvance=6 page=0 chnl=0 +char id=60 x=162 y=22 width=14 height=14 xoffset=-1 yoffset=8 xadvance=12 page=0 chnl=0 +char id=61 x=96 y=114 width=14 height=10 xoffset=-1 yoffset=10 xadvance=12 page=0 chnl=0 +char id=62 x=146 y=102 width=14 height=14 xoffset=-1 yoffset=8 xadvance=12 page=0 chnl=0 +char id=63 x=210 y=2 width=12 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=64 x=2 y=102 width=18 height=18 xoffset=-1 yoffset=4 xadvance=16 page=0 chnl=0 +char id=65 x=78 y=22 width=16 height=18 xoffset=-2 yoffset=4 xadvance=14 page=0 chnl=0 +char id=66 x=96 y=94 width=14 height=18 xoffset=0 yoffset=4 xadvance=15 page=0 chnl=0 +char id=67 x=78 y=2 width=16 height=18 xoffset=-1 yoffset=4 xadvance=15 page=0 chnl=0 +char id=68 x=60 y=102 width=16 height=18 xoffset=0 yoffset=4 xadvance=15 page=0 chnl=0 +char id=69 x=96 y=74 width=14 height=18 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=0 +char id=70 x=96 y=54 width=14 height=18 xoffset=0 yoffset=4 xadvance=12 page=0 chnl=0 +char id=71 x=60 y=82 width=16 height=18 xoffset=-1 yoffset=4 xadvance=16 page=0 chnl=0 +char id=72 x=60 y=62 width=16 height=18 xoffset=0 yoffset=4 xadvance=15 page=0 chnl=0 +char id=73 x=194 y=56 width=6 height=18 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=74 x=196 y=2 width=12 height=18 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 +char id=75 x=60 y=42 width=16 height=18 xoffset=0 yoffset=4 xadvance=15 page=0 chnl=0 +char id=76 x=96 y=34 width=14 height=18 xoffset=0 yoffset=4 xadvance=12 page=0 chnl=0 +char id=77 x=2 y=82 width=18 height=18 xoffset=0 yoffset=4 xadvance=19 page=0 chnl=0 +char id=78 x=60 y=22 width=16 height=18 xoffset=0 yoffset=4 xadvance=15 page=0 chnl=0 +char id=79 x=2 y=62 width=18 height=18 xoffset=-1 yoffset=4 xadvance=16 page=0 chnl=0 +char id=80 x=78 y=102 width=14 height=18 xoffset=0 yoffset=4 xadvance=14 page=0 chnl=0 +char id=81 x=2 y=42 width=18 height=18 xoffset=-1 yoffset=5 xadvance=16 page=0 chnl=0 +char id=82 x=60 y=2 width=16 height=18 xoffset=0 yoffset=4 xadvance=15 page=0 chnl=0 +char id=83 x=42 y=102 width=16 height=18 xoffset=-1 yoffset=4 xadvance=13 page=0 chnl=0 +char id=84 x=78 y=82 width=14 height=18 xoffset=-1 yoffset=4 xadvance=13 page=0 chnl=0 +char id=85 x=42 y=82 width=16 height=18 xoffset=0 yoffset=4 xadvance=15 page=0 chnl=0 +char id=86 x=42 y=62 width=16 height=18 xoffset=-2 yoffset=4 xadvance=13 page=0 chnl=0 +char id=87 x=2 y=2 width=22 height=18 xoffset=-1 yoffset=4 xadvance=19 page=0 chnl=0 +char id=88 x=42 y=42 width=16 height=18 xoffset=-2 yoffset=4 xadvance=14 page=0 chnl=0 +char id=89 x=42 y=22 width=16 height=18 xoffset=-2 yoffset=4 xadvance=14 page=0 chnl=0 +char id=90 x=42 y=2 width=16 height=18 xoffset=-1 yoffset=4 xadvance=13 page=0 chnl=0 +char id=91 x=162 y=100 width=8 height=22 xoffset=0 yoffset=3 xadvance=7 page=0 chnl=0 +char id=92 x=134 y=90 width=10 height=18 xoffset=-2 yoffset=4 xadvance=8 page=0 chnl=0 +char id=93 x=162 y=76 width=8 height=22 xoffset=-1 yoffset=3 xadvance=7 page=0 chnl=0 +char id=94 x=210 y=38 width=12 height=10 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=0 +char id=95 x=210 y=50 width=12 height=4 xoffset=-2 yoffset=20 xadvance=10 page=0 chnl=0 +char id=96 x=214 y=56 width=8 height=6 xoffset=-2 yoffset=4 xadvance=6 page=0 chnl=0 +char id=97 x=146 y=86 width=14 height=14 xoffset=-1 yoffset=8 xadvance=12 page=0 chnl=0 +char id=98 x=78 y=62 width=14 height=18 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=0 +char id=99 x=146 y=70 width=14 height=14 xoffset=-1 yoffset=8 xadvance=12 page=0 chnl=0 +char id=100 x=26 y=106 width=14 height=18 xoffset=-1 yoffset=4 xadvance=13 page=0 chnl=0 +char id=101 x=146 y=54 width=14 height=14 xoffset=-1 yoffset=8 xadvance=12 page=0 chnl=0 +char id=102 x=134 y=70 width=10 height=18 xoffset=-2 yoffset=4 xadvance=7 page=0 chnl=0 +char id=103 x=26 y=86 width=14 height=18 xoffset=-1 yoffset=7 xadvance=13 page=0 chnl=0 +char id=104 x=182 y=2 width=12 height=18 xoffset=0 yoffset=4 xadvance=12 page=0 chnl=0 +char id=105 x=186 y=100 width=6 height=18 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=106 x=176 y=86 width=8 height=20 xoffset=-2 yoffset=5 xadvance=6 page=0 chnl=0 +char id=107 x=26 y=66 width=14 height=18 xoffset=0 yoffset=4 xadvance=12 page=0 chnl=0 +char id=108 x=186 y=80 width=6 height=18 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=109 x=96 y=18 width=18 height=14 xoffset=0 yoffset=8 xadvance=19 page=0 chnl=0 +char id=110 x=236 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=12 page=0 chnl=0 +char id=111 x=146 y=38 width=14 height=14 xoffset=-1 yoffset=8 xadvance=13 page=0 chnl=0 +char id=112 x=26 y=46 width=14 height=18 xoffset=0 yoffset=7 xadvance=13 page=0 chnl=0 +char id=113 x=26 y=26 width=14 height=18 xoffset=-1 yoffset=7 xadvance=13 page=0 chnl=0 +char id=114 x=134 y=110 width=10 height=14 xoffset=0 yoffset=8 xadvance=8 page=0 chnl=0 +char id=115 x=222 y=22 width=12 height=14 xoffset=-1 yoffset=8 xadvance=11 page=0 chnl=0 +char id=116 x=186 y=38 width=10 height=16 xoffset=-1 yoffset=6 xadvance=8 page=0 chnl=0 +char id=117 x=208 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=12 page=0 chnl=0 +char id=118 x=146 y=22 width=14 height=14 xoffset=-1 yoffset=8 xadvance=11 page=0 chnl=0 +char id=119 x=96 y=2 width=20 height=14 xoffset=-1 yoffset=8 xadvance=17 page=0 chnl=0 +char id=120 x=224 y=2 width=14 height=14 xoffset=-2 yoffset=8 xadvance=11 page=0 chnl=0 +char id=121 x=150 y=2 width=14 height=16 xoffset=-2 yoffset=9 xadvance=11 page=0 chnl=0 +char id=122 x=194 y=22 width=12 height=14 xoffset=-1 yoffset=8 xadvance=11 page=0 chnl=0 +char id=123 x=134 y=46 width=10 height=22 xoffset=-2 yoffset=3 xadvance=7 page=0 chnl=0 +char id=124 x=186 y=56 width=6 height=22 xoffset=0 yoffset=4 xadvance=5 page=0 chnl=0 +char id=125 x=134 y=22 width=10 height=22 xoffset=-2 yoffset=3 xadvance=7 page=0 chnl=0 +char id=126 x=146 y=118 width=12 height=6 xoffset=0 yoffset=12 xadvance=12 page=0 chnl=0 diff --git a/assets/helvetica-20-white.png b/assets/helvetica-20-white.png new file mode 100644 index 0000000..2eaf5c4 Binary files /dev/null and b/assets/helvetica-20-white.png differ diff --git a/docs/Helvetica-20-white.bmglyph b/docs/Helvetica-20-white.bmglyph new file mode 100644 index 0000000..deee65b Binary files /dev/null and b/docs/Helvetica-20-white.bmglyph differ diff --git a/src/dust/app/AppConfig.hx b/src/dust/app/AppConfig.hx index 2f5827d..40f3512 100644 --- a/src/dust/app/AppConfig.hx +++ b/src/dust/app/AppConfig.hx @@ -1,5 +1,6 @@ package dust.app; +import dust.app.data.AppTarget; import nme.Vector; import nme.ui.Multitouch; import dust.app.data.AppData; @@ -15,15 +16,31 @@ class AppConfig implements Config function makeApp():AppData { + var width = nme.Lib.current.stage.stageWidth; + var height = nme.Lib.current.stage.stageHeight; + var isMultiTouch = nme.ui.Multitouch.supportsTouchEvents; + var app = new AppData(); - app.deviceWidth = Std.int(nme.system.Capabilities.screenResolutionX); - app.deviceHeight = Std.int(nme.system.Capabilities.screenResolutionY); - app.isMultiTouch = nme.ui.Multitouch.supportsTouchEvents; + app.stageWidth = Std.int(width); + app.stageHeight = Std.int(height); + app.target = getTarget(width, height, isMultiTouch); app.hasGestures = nme.ui.Multitouch.supportsGestureEvents; app.supportedGestures = toArray(nme.ui.Multitouch.supportedGestures); + return app; } + function getTarget(width:Int, height:Int, isMultiTouch:Bool):AppTarget + { + var max = width > height ? width : height; + return if (max == 2048 && isMultiTouch) + AppTarget.IPAD_RETINA; + else if (max == 1024 && isMultiTouch) + AppTarget.IPAD_NORMAL; + else + AppTarget.WEB; + } + function toArray(list:Vector):Array { var output = new Array(); diff --git a/src/dust/app/data/AppData.hx b/src/dust/app/data/AppData.hx index be6075c..edde46c 100644 --- a/src/dust/app/data/AppData.hx +++ b/src/dust/app/data/AppData.hx @@ -2,9 +2,9 @@ package dust.app.data; class AppData { - public var deviceWidth:Int; - public var deviceHeight:Int; - public var isMultiTouch:Bool; + public var stageWidth:Int; + public var stageHeight:Int; + public var target:AppTarget; public var hasGestures:Bool; public var supportedGestures:Array; diff --git a/src/dust/app/data/AppTarget.hx b/src/dust/app/data/AppTarget.hx new file mode 100644 index 0000000..a273db0 --- /dev/null +++ b/src/dust/app/data/AppTarget.hx @@ -0,0 +1,8 @@ +package dust.app.data; + +enum AppTarget +{ + WEB; + IPAD_NORMAL; + IPAD_RETINA; +} \ No newline at end of file diff --git a/src/dust/camera/CameraConfig.hx b/src/dust/camera/CameraConfig.hx index b443b43..3bff289 100644 --- a/src/dust/camera/CameraConfig.hx +++ b/src/dust/camera/CameraConfig.hx @@ -1,5 +1,6 @@ package dust.camera; +import dust.app.data.AppTarget; import dust.app.data.AppData; import dust.app.AppConfig; import dust.collections.CollectionsConfig; @@ -37,10 +38,15 @@ class CameraConfig implements DependentConfig function makeCamera():Camera { - var stage = nme.Lib.current.stage; - screenCenterX = Std.int(app.deviceWidth * 0.5); - screenCenterY = Std.int(app.deviceHeight * 0.5); - - return new Camera(screenCenterX, screenCenterY); + screenCenterX = Std.int(app.stageWidth * 0.5); + screenCenterY = Std.int(app.stageHeight * 0.5); + + return switch (app.target) + { + case AppTarget.IPAD_RETINA: + new Camera(screenCenterX, screenCenterY, 2); + default: + new Camera(screenCenterX, screenCenterY, 1); + } } } diff --git a/src/dust/camera/data/Camera.hx b/src/dust/camera/data/Camera.hx index cd7196c..74aee00 100644 --- a/src/dust/camera/data/Camera.hx +++ b/src/dust/camera/data/Camera.hx @@ -14,13 +14,14 @@ class Camera extends Component public var worldY:Float; public var scalar:Float; - public function new(screenCenterX:Int, screenCenterY:Int) + public function new(screenCenterX:Int, screenCenterY:Int, scalar:Float = 1) { this.screenCenterX = screenCenterX; this.screenCenterY = screenCenterY; + this.scalar = scalar; + worldX = 0; worldY = 0; - scalar = 1; } public function set(worldX:Float, worldY:Float) diff --git a/src/dust/console/impl/Console.hx b/src/dust/console/impl/Console.hx index a577f78..4bbe18e 100644 --- a/src/dust/console/impl/Console.hx +++ b/src/dust/console/impl/Console.hx @@ -34,6 +34,11 @@ class Console extends Sprite input.command.bind(onCommand); } + public function write(value:String, ?color:Int = 0xFFFFFF) + { + output.write(value, color); + } + public function enable() { if (!isEnabled) diff --git a/src/dust/console/ui/ConsoleInput.hx b/src/dust/console/ui/ConsoleInput.hx index a2037e0..e1cca26 100644 --- a/src/dust/console/ui/ConsoleInput.hx +++ b/src/dust/console/ui/ConsoleInput.hx @@ -29,8 +29,8 @@ class ConsoleInput extends Sprite function makeInput(app:AppData) { var input = new TextField(); - input.y = app.deviceHeight - 20; - input.width = app.deviceWidth; + input.y = app.stageHeight - 20; + input.width = app.stageWidth; input.height = 20; input.background = true; input.backgroundColor = 0x006600; diff --git a/src/dust/console/ui/ConsoleOutput.hx b/src/dust/console/ui/ConsoleOutput.hx index d7e1984..516154a 100644 --- a/src/dust/console/ui/ConsoleOutput.hx +++ b/src/dust/console/ui/ConsoleOutput.hx @@ -32,7 +32,7 @@ class ConsoleOutput extends Sprite { var shape = new Shape(); shape.graphics.beginFill(0x006600, 0.8); - shape.graphics.drawRect(0, 0, app.deviceWidth, app.deviceHeight); + shape.graphics.drawRect(0, 0, app.stageWidth, app.stageHeight); shape.graphics.endFill(); addChild(shape); return shape; @@ -41,8 +41,8 @@ class ConsoleOutput extends Sprite function makeTextfield(app:AppData):TextField { var textfield = new TextField(); - textfield.width = app.deviceWidth; - textfield.height = app.deviceHeight - 20; + textfield.width = app.stageWidth; + textfield.height = app.stageHeight - 20; textfield.background = false; textfield.defaultTextFormat = format; textfield.multiline = true; diff --git a/src/dust/mainmenu/MainMenuConfig.hx b/src/dust/mainmenu/MainMenuConfig.hx index ce99843..ae1f627 100644 --- a/src/dust/mainmenu/MainMenuConfig.hx +++ b/src/dust/mainmenu/MainMenuConfig.hx @@ -1,9 +1,10 @@ package dust.mainmenu; +import dust.app.data.AppTarget; import nme.display.DisplayObjectContainer; import dust.app.data.AppData; import dust.app.AppConfig; -import dust.text.Helvetica10WhiteFontConfig; +import dust.text.HelveticaSmallWhiteFontConfig; import dust.mainmenu.control.MainMenuButtonFactory; import dust.graphics.data.Paint; import dust.text.Michroma24WhiteFontConfig; @@ -27,7 +28,7 @@ class MainMenuConfig implements DependentConfig @inject public var root:DisplayObjectContainer; public function dependencies():Array> - return [AppConfig, SignalMapConfig, Helvetica10WhiteFontConfig] + return [AppConfig, SignalMapConfig, HelveticaSmallWhiteFontConfig] public function configure() { @@ -40,11 +41,17 @@ class MainMenuConfig implements DependentConfig function makeConfig():MainMenuButtonConfig { - var font = fonts.get(Helvetica10WhiteFontConfig.HELVETICA_10_WHITE); + var font = fonts.get(HelveticaSmallWhiteFontConfig.FONT); var paint = new Paint() .setFill(0x1E90FF) .setLine(1, 0xFFFFFF); - return new MainMenuButtonConfig(app, font, paint, 160, 40, 20); + return switch (app.target) + { + case AppTarget.IPAD_RETINA: + new MainMenuButtonConfig(app, font, paint, 320, 80, 40); + default: + new MainMenuButtonConfig(app, font, paint, 160, 40, 20); + } } } diff --git a/src/dust/mainmenu/data/MainMenuButtonConfig.hx b/src/dust/mainmenu/data/MainMenuButtonConfig.hx index fec4280..12c376e 100644 --- a/src/dust/mainmenu/data/MainMenuButtonConfig.hx +++ b/src/dust/mainmenu/data/MainMenuButtonConfig.hx @@ -40,5 +40,5 @@ class MainMenuButtonConfig } public function rows():Int - return Std.int((app.deviceHeight - padding) / (height + padding)) + return Std.int((app.stageHeight - padding) / (height + padding)) } diff --git a/src/dust/text/Helvetica10WhiteFontConfig.hx b/src/dust/text/Helvetica10WhiteFontConfig.hx deleted file mode 100644 index e4df0e8..0000000 --- a/src/dust/text/Helvetica10WhiteFontConfig.hx +++ /dev/null @@ -1,37 +0,0 @@ -package dust.text; - -import nme.errors.Error; -import nme.display.BitmapData; -import nme.Assets; -import dust.text.data.BitmapFont; -import dust.text.control.BitmapFontFactory; -import dust.text.control.BitmapFonts; -import dust.context.Config; -import dust.context.DependentConfig; - -class Helvetica10WhiteFontConfig implements DependentConfig -{ - public static var HELVETICA_10_WHITE = 'helvetica-10-white'; - - @inject public var factory:BitmapFontFactory; - @inject public var fonts:BitmapFonts; - - public function dependencies():Array> - return [BitmapTextConfig] - - public function configure() - fonts.add(HELVETICA_10_WHITE, makeFont()) - - function makeFont():BitmapFont - { - var definition = Assets.getText('assets/helvetica-10-white.fnt'); - if (definition == null) - definition = ''; - - var bitmapData = Assets.getBitmapData('assets/helvetica-10-white.png'); - if (bitmapData == null) - bitmapData = new BitmapData(1, 1, true, 0); - - return factory.make(definition, [bitmapData]); - } -} diff --git a/src/dust/text/HelveticaSmallWhiteFontConfig.hx b/src/dust/text/HelveticaSmallWhiteFontConfig.hx new file mode 100644 index 0000000..e0a647e --- /dev/null +++ b/src/dust/text/HelveticaSmallWhiteFontConfig.hx @@ -0,0 +1,61 @@ +package dust.text; + +import dust.app.data.AppTarget; +import dust.app.data.AppData; +import dust.app.AppConfig; +import nme.errors.Error; +import nme.display.BitmapData; +import nme.Assets; +import dust.text.data.BitmapFont; +import dust.text.control.BitmapFontFactory; +import dust.text.control.BitmapFonts; +import dust.context.Config; +import dust.context.DependentConfig; + +class HelveticaSmallWhiteFontConfig implements DependentConfig +{ + public static var FONT = 'helvetica-normal-white'; + + static var FONT_10 = 'helvetica-10-white'; + static var FONT_20 = 'helvetica-20-white'; + + @inject public var app:AppData; + @inject public var factory:BitmapFontFactory; + @inject public var fonts:BitmapFonts; + + public function dependencies():Array> + return [AppConfig, BitmapTextConfig] + + public function configure() + fonts.add(FONT, makeFont()) + + function makeFont():BitmapFont + { + var definition = getFontDefinition(); + if (definition == null) + definition = ''; + + var bitmapData = getFontAsset(); + if (bitmapData == null) + bitmapData = new BitmapData(1, 1, true, 0); + + return factory.make(definition, [bitmapData]); + } + + function getFontDefinition():String + return Assets.getText('assets/' + getFontTarget() + '.fnt') + + function getFontAsset():BitmapData + return Assets.getBitmapData('assets/' + getFontTarget() + '.png') + + function getFontTarget() + { + return switch(app.target) + { + case AppTarget.IPAD_RETINA: + FONT_20; + default: + FONT_10; + } + } +}