HendrixString / Starling-Bidi-TextField

Bidirectional(RTL languages) Bitmap Font TextField control for Starling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starling-Bidi-TextField

Bidirectional Bitmap Font TextField control for Starling

How to use

simply fork or download the project, you can also download the binary itself and link it to your project, or import to your IDE of choice such as Flash Builder 4.7. requires Starling framework.

Features

  • now you can use Bidirectional text with bitmap fonts in stage3d.
  • full implementation of the UNICODE BIDIRECTIONAL ALGORITHM revision 31.
  • supports text truncation.
  • supports text truncation.

Guide

[Embed(source="assets/fonts/bf/arr.fnt", mimeType="application/octet-stream")]
public static const FontXml:Class;

[Embed(source = "assets/fonts/bf/arr_0.png")]
public static const FontTexture:Class;

protected function init(): void
{
  var text:String           = 'טקסט בשפה עברית. טקסט בשפה עברית 12345 טקסט בשפה אנגלית hello world שלום עולם';
  
  var texture:  Texture     = Texture.fromBitmap(new FontTexture(), false);
  var xml:      XML         = XML(new FontXml());
  
  BidiTextField.registerBitmapFont(new BidiBitmapFont(texture,xml), "ArialBD");
  
  var tfBidi: BidiTextField = new BidiTextField(1, 1, "", "ArialBD");
  tfBidi.fontSize           = 20;
  tfBidi.isTrancted         = true;
  tfBidi.bidiLevel          = 1;
  tfBidi.color              = 0x00;
  tfBidi.hAlign             = HAlign.RIGHT;
  tfBidi.vAlign             = VAlign.TOP;
  tfBidi.width              = width;
  tfBidi.height             = 200;

  tfBidi.text               = text;
  
  addChild(tfBidi);
}

Dependencies

Terms

Contact Author

About

Bidirectional(RTL languages) Bitmap Font TextField control for Starling


Languages

Language:ActionScript 100.0%