Created
August 29, 2016 15:59
-
-
Save SelStrom/34df20c6da76bc295f96c74d8095a020 to your computer and use it in GitHub Desktop.
Feathers dev 3.1 bug viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import feathers.controls.AutoSizeMode; | |
import feathers.controls.Button; | |
import feathers.controls.Label; | |
import feathers.controls.LayoutGroup; | |
import feathers.controls.text.BitmapFontTextRenderer; | |
import feathers.layout.AnchorLayout; | |
import feathers.layout.AnchorLayoutData; | |
import feathers.layout.HorizontalAlign; | |
import feathers.layout.VerticalAlign; | |
import feathers.layout.VerticalLayout; | |
import feathers.text.BitmapFontTextFormat; | |
import feathers.themes.BaseMinimalDesktopTheme; | |
import feathers.themes.MinimalDesktopTheme; | |
import flash.text.TextFormatAlign; | |
import starling.textures.TextureSmoothing; | |
/** | |
* ... | |
* @author Shatalov Andrey | |
*/ | |
public class Application extends LayoutGroup { | |
public function Application() { | |
super(); | |
this.autoSizeMode = AutoSizeMode.STAGE; | |
new MinimalDesktopTheme(); | |
var stagelayout : AnchorLayout = new AnchorLayout(); | |
this.layout = stagelayout; | |
var layoutGroup : LayoutGroup = new LayoutGroup(); | |
var layout : VerticalLayout = new VerticalLayout(); | |
layout.horizontalAlign = HorizontalAlign.JUSTIFY; | |
layout.verticalAlign = VerticalAlign.MIDDLE; | |
layoutGroup.layout = layout; | |
layoutGroup.layoutData = new AnchorLayoutData(NaN, NaN, NaN, NaN, 0, 0); | |
this.addChild(layoutGroup); | |
var button : Button = new Button(); | |
button.label = "Long long long long long long long long long long long long long long long text"; | |
layoutGroup.addChild(button); | |
var label : Label = new Label(); | |
label.textRendererFactory = factory; | |
label.text = "Something centered bitmap text"; | |
layoutGroup.addChild(label); | |
var button2 : Button = new Button(); | |
button2.label = "Another long long long long long long long long long long long long long long long text"; | |
layoutGroup.addChild(button2); | |
} | |
private function factory() : BitmapFontTextRenderer { | |
var renderer : BitmapFontTextRenderer = new BitmapFontTextRenderer(); | |
renderer.textureSmoothing = TextureSmoothing.NONE; | |
renderer.textFormat = new BitmapFontTextFormat(BaseMinimalDesktopTheme.FONT_NAME, 14, 0x0, TextFormatAlign.CENTER); | |
return renderer; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment