package scripts;
import com.stencyl.Config;
import com.stencyl.Engine;
import com.stencyl.models.Font;
import openfl.display.BitmapData;
import openfl.display.Graphics;
import openfl.geom.Matrix;
class F
{
public var gr:Graphics = Engine.engine.transitionLayer.graphics;
public var a:Float=1; public var c:Int=16777215; public var l:Int=-1;
public var m:Matrix= new Matrix(); public var s:Float=1;
public var f_de:Font = new Font(-1, 0, "", true); public var f_cu:Font = new Font(-1, 0, "", true);
public var fontdata: Array<BitmapData> = [];
public function new(){}
public function ds(s:String,x:Float,y:Float):Void
{
if(this.f_cu == null ||""+this.f_cu == "undefined"){this.f_cu = f_de;}
this.m.identity(); this.m.translate(x,y);
var toDraw:BitmapData = null;
var w = this.f_cu.font.getTextWidth(s,this.l,this.s);
var h = Std.int(this.f_cu.font.getFontHeight()*this.s);
if(w > 0 && h > 0)
{
// the highlighted is the oens being changed for flash version
this.fontdata = this.f_cu.font.getPreparedGlyphs(this.s,this.c, true);
toDraw = new BitmapData(w, h, true, 0);
this.f_cu.font.render(toDraw,this.fontdata, s,this.c,this.a, 0, 0,this.l,this.s, 0); //0, false
}
if(toDraw != null)
{
this.gr.beginBitmapFill(toDraw, this.m, false, Config.antialias);
this.gr.drawRect(x,y, toDraw.width, toDraw.height);
this.gr.endFill();
}
}
public function g_textw(s:String):Int{return this.f_cu.font.getTextWidth(s,0,this.s) + this.l*s.length;}
For HTML 5 versions and other details