#include <hxcpp.h>

#ifndef INCLUDED_IMap
#include <IMap.h>
#endif
#ifndef INCLUDED_Lambda
#include <Lambda.h>
#endif
#ifndef INCLUDED_Luxe
#include <Luxe.h>
#endif
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_StringTools
#include <StringTools.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
#ifndef INCLUDED_haxe_ds_IntMap
#include <haxe/ds/IntMap.h>
#endif
#ifndef INCLUDED_haxe_ds_ObjectMap
#include <haxe/ds/ObjectMap.h>
#endif
#ifndef INCLUDED_haxe_ds_StringMap
#include <haxe/ds/StringMap.h>
#endif
#ifndef INCLUDED_haxe_io_Path
#include <haxe/io/Path.h>
#endif
#ifndef INCLUDED_hxMath
#include <hxMath.h>
#endif
#ifndef INCLUDED_luxe_ID
#include <luxe/ID.h>
#endif
#ifndef INCLUDED_luxe_resource_Resource
#include <luxe/resource/Resource.h>
#endif
#ifndef INCLUDED_luxe_resource_ResourceManager
#include <luxe/resource/ResourceManager.h>
#endif
#ifndef INCLUDED_luxe_resource_ResourceType
#include <luxe/resource/ResourceType.h>
#endif
#ifndef INCLUDED_luxe_resource_TextResource
#include <luxe/resource/TextResource.h>
#endif
#ifndef INCLUDED_phoenix_Batcher
#include <phoenix/Batcher.h>
#endif
#ifndef INCLUDED_phoenix_BitmapFont
#include <phoenix/BitmapFont.h>
#endif
#ifndef INCLUDED_phoenix_Color
#include <phoenix/Color.h>
#endif
#ifndef INCLUDED_phoenix_FilterType
#include <phoenix/FilterType.h>
#endif
#ifndef INCLUDED_phoenix_PrimitiveType
#include <phoenix/PrimitiveType.h>
#endif
#ifndef INCLUDED_phoenix_Rectangle
#include <phoenix/Rectangle.h>
#endif
#ifndef INCLUDED_phoenix_Renderer
#include <phoenix/Renderer.h>
#endif
#ifndef INCLUDED_phoenix_TextAlign
#include <phoenix/TextAlign.h>
#endif
#ifndef INCLUDED_phoenix_Texture
#include <phoenix/Texture.h>
#endif
#ifndef INCLUDED_phoenix_Transform
#include <phoenix/Transform.h>
#endif
#ifndef INCLUDED_phoenix_Vector
#include <phoenix/Vector.h>
#endif
#ifndef INCLUDED_phoenix_geometry_CompositeGeometry
#include <phoenix/geometry/CompositeGeometry.h>
#endif
#ifndef INCLUDED_phoenix_geometry_Geometry
#include <phoenix/geometry/Geometry.h>
#endif
#ifndef INCLUDED_phoenix_geometry_TextureCoord
#include <phoenix/geometry/TextureCoord.h>
#endif
#ifndef INCLUDED_phoenix_geometry_TextureCoordSet
#include <phoenix/geometry/TextureCoordSet.h>
#endif
#ifndef INCLUDED_phoenix_geometry_Vertex
#include <phoenix/geometry/Vertex.h>
#endif
namespace phoenix{

Void BitmapFont_obj::__construct(::luxe::resource::ResourceManager _resource_manager)
{
HX_STACK_FRAME("phoenix.BitmapFont","new",0x6066476f,"phoenix.BitmapFont.new","phoenix/BitmapFont.hx",57,0xdfcf0e40)

HX_STACK_ARG(_resource_manager,"_resource_manager")
{
	HX_STACK_LINE(70)
	this->pages_loaded = (int)0;
	HX_STACK_LINE(64)
	this->font_character_count = (int)0;
	HX_STACK_LINE(63)
	this->font_size = 0.0;
	HX_STACK_LINE(62)
	this->line_height = 0.0;
	HX_STACK_LINE(61)
	this->spacing = 0.0;
	HX_STACK_LINE(77)
	super::__construct(_resource_manager,::luxe::resource::ResourceType_obj::font,null());
	HX_STACK_LINE(79)
	this->id = HX_CSTRING("Unnamed font");
	HX_STACK_LINE(81)
	this->line_widths = Array_obj< Float >::__new();
	HX_STACK_LINE(82)
	this->dimensions = ::phoenix::Vector_obj::__new(null(),null(),null(),null());
	HX_STACK_LINE(83)
	this->characters = ::haxe::ds::IntMap_obj::__new();
	HX_STACK_LINE(84)
	this->kernings = ::haxe::ds::ObjectMap_obj::__new();
	HX_STACK_LINE(85)
	this->scale = ::phoenix::Vector_obj::__new((int)1,(int)1,null(),null());
	HX_STACK_LINE(86)
	this->pages = ::haxe::ds::IntMap_obj::__new();
	HX_STACK_LINE(88)
	this->on_pages_loaded = this->on_all_pages_loaded_dyn();
}
;
	return null();
}

//BitmapFont_obj::~BitmapFont_obj() { }

Dynamic BitmapFont_obj::__CreateEmpty() { return  new BitmapFont_obj; }
hx::ObjectPtr< BitmapFont_obj > BitmapFont_obj::__new(::luxe::resource::ResourceManager _resource_manager)
{  hx::ObjectPtr< BitmapFont_obj > result = new BitmapFont_obj();
	result->__construct(_resource_manager);
	return result;}

Dynamic BitmapFont_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< BitmapFont_obj > result = new BitmapFont_obj();
	result->__construct(inArgs[0]);
	return result;}

::String BitmapFont_obj::toString( ){
	HX_STACK_FRAME("phoenix.BitmapFont","toString",0xce67633d,"phoenix.BitmapFont.toString","phoenix/BitmapFont.hx",93,0xdfcf0e40)
	HX_STACK_THIS(this)
	HX_STACK_LINE(93)
	return ((HX_CSTRING("BitmapFont(") + this->id) + HX_CSTRING(")"));
}


HX_DEFINE_DYNAMIC_FUNC0(BitmapFont_obj,toString,return )

::haxe::ds::StringMap BitmapFont_obj::_tokenize_font_line( Array< ::String > _line_tokens){
	HX_STACK_FRAME("phoenix.BitmapFont","_tokenize_font_line",0x0ab88a4e,"phoenix.BitmapFont._tokenize_font_line","phoenix/BitmapFont.hx",111,0xdfcf0e40)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_line_tokens,"_line_tokens")
	HX_STACK_LINE(112)
	::haxe::ds::StringMap _item_map = ::haxe::ds::StringMap_obj::__new();		HX_STACK_VAR(_item_map,"_item_map");
	HX_STACK_LINE(113)
	{
		HX_STACK_LINE(113)
		int _g = (int)0;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(113)
		while(((_g < _line_tokens->length))){
			HX_STACK_LINE(113)
			::String _line_token = _line_tokens->__get(_g);		HX_STACK_VAR(_line_token,"_line_token");
			HX_STACK_LINE(113)
			++(_g);
			HX_STACK_LINE(114)
			Array< ::String > _items = _line_token.split(HX_CSTRING("="));		HX_STACK_VAR(_items,"_items");
			struct _Function_3_1{
				inline static Dynamic Block( Array< ::String > &_items){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/BitmapFont.hx",115,0xdfcf0e40)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("key") , _items->__get((int)0),false);
						__result->Add(HX_CSTRING("value") , _items->__get((int)1),false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(115)
			_item_map->set(_items->__get((int)0),_Function_3_1::Block(_items));
		}
	}
	HX_STACK_LINE(117)
	return _item_map;
}


HX_DEFINE_DYNAMIC_FUNC1(BitmapFont_obj,_tokenize_font_line,return )

Void BitmapFont_obj::on_all_pages_loaded( ){
{
		HX_STACK_FRAME("phoenix.BitmapFont","on_all_pages_loaded",0xd5d0b76d,"phoenix.BitmapFont.on_all_pages_loaded","phoenix/BitmapFont.hx",121,0xdfcf0e40)
		HX_STACK_THIS(this)
		HX_STACK_LINE(121)
		if (((this->onload_dyn() != null()))){
			HX_STACK_LINE(122)
			this->onload(hx::ObjectPtr<OBJ_>(this));
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(BitmapFont_obj,on_all_pages_loaded,(void))

Void BitmapFont_obj::one_page_loaded( ::phoenix::Texture t){
{
		HX_STACK_FRAME("phoenix.BitmapFont","one_page_loaded",0x62b4922b,"phoenix.BitmapFont.one_page_loaded","phoenix/BitmapFont.hx",126,0xdfcf0e40)
		HX_STACK_THIS(this)
		HX_STACK_ARG(t,"t")
		HX_STACK_LINE(127)
		(this->pages_loaded)++;
		HX_STACK_LINE(128)
		if (((this->pages_loaded == ::Lambda_obj::count(this->pages,null())))){
			HX_STACK_LINE(129)
			this->on_all_pages_loaded();
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(BitmapFont_obj,one_page_loaded,(void))

Void BitmapFont_obj::from_string( ::String __o__bitmap_file,::String __o__folder,Dynamic onloaded,Array< ::Dynamic > custom_pages){
::String _bitmap_file = __o__bitmap_file.Default(HX_CSTRING(""));
::String _folder = __o__folder.Default(HX_CSTRING("assets/"));
	HX_STACK_FRAME("phoenix.BitmapFont","from_string",0xa09d1455,"phoenix.BitmapFont.from_string","phoenix/BitmapFont.hx",136,0xdfcf0e40)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_bitmap_file,"_bitmap_file")
	HX_STACK_ARG(_folder,"_folder")
	HX_STACK_ARG(onloaded,"onloaded")
	HX_STACK_ARG(custom_pages,"custom_pages")
{
		HX_STACK_LINE(133)
		Array< ::Dynamic > _g1 = Array_obj< ::Dynamic >::__new().Add(hx::ObjectPtr<OBJ_>(this));		HX_STACK_VAR(_g1,"_g1");
		HX_STACK_LINE(138)
		Array< ::String > lines = _bitmap_file.split(HX_CSTRING("\n"));		HX_STACK_VAR(lines,"lines");
		HX_STACK_LINE(139)
		Dynamic _pages = Dynamic( Array_obj<Dynamic>::__new());		HX_STACK_VAR(_pages,"_pages");
		HX_STACK_LINE(142)
		this->onload = onloaded;
		HX_STACK_LINE(144)
		{
			HX_STACK_LINE(144)
			int _g = (int)0;		HX_STACK_VAR(_g,"_g");
			HX_STACK_LINE(144)
			while(((_g < lines->length))){
				HX_STACK_LINE(144)
				::String line = lines->__get(_g);		HX_STACK_VAR(line,"line");
				HX_STACK_LINE(144)
				++(_g);
				HX_STACK_LINE(145)
				Array< ::String > _initial_tokens = line.split(HX_CSTRING(" "));		HX_STACK_VAR(_initial_tokens,"_initial_tokens");
				HX_STACK_LINE(146)
				{
					HX_STACK_LINE(146)
					::String _g11 = _initial_tokens->__get((int)0);		HX_STACK_VAR(_g11,"_g11");
					HX_STACK_LINE(146)
					::String _switch_1 = (_g11);
					if (  ( _switch_1==HX_CSTRING("info"))){
						HX_STACK_LINE(150)
						_initial_tokens->remove(HX_CSTRING("info"));
						HX_STACK_LINE(151)
						::haxe::ds::StringMap _items = this->_tokenize_font_line(_initial_tokens);		HX_STACK_VAR(_items,"_items");
						HX_STACK_LINE(153)
						::String _id = _items->get(HX_CSTRING("face"))->__Field(HX_CSTRING("value"),true);		HX_STACK_VAR(_id,"_id");
						HX_STACK_LINE(154)
						if (((_id.indexOf(HX_CSTRING("\""),null()) != (int)-1))){
							HX_STACK_LINE(155)
							_id = ::StringTools_obj::replace(_id,HX_CSTRING("\""),HX_CSTRING(""));
						}
						HX_STACK_LINE(159)
						this->font_size = ::Std_obj::parseFloat(_items->get(HX_CSTRING("size"))->__Field(HX_CSTRING("value"),true));
						HX_STACK_LINE(161)
						this->id = _id;
					}
					else if (  ( _switch_1==HX_CSTRING("common"))){
						HX_STACK_LINE(165)
						_initial_tokens->remove(HX_CSTRING("common"));
						HX_STACK_LINE(166)
						::haxe::ds::StringMap _items = this->_tokenize_font_line(_initial_tokens);		HX_STACK_VAR(_items,"_items");
						HX_STACK_LINE(169)
						this->line_height = ::Std_obj::parseFloat(_items->get(HX_CSTRING("lineHeight"))->__Field(HX_CSTRING("value"),true));
					}
					else if (  ( _switch_1==HX_CSTRING("page"))){
						HX_STACK_LINE(174)
						_initial_tokens->remove(HX_CSTRING("page"));
						HX_STACK_LINE(175)
						::haxe::ds::StringMap _items = this->_tokenize_font_line(_initial_tokens);		HX_STACK_VAR(_items,"_items");
						HX_STACK_LINE(178)
						Dynamic _id = ::Std_obj::parseInt(_items->get(HX_CSTRING("id"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_id,"_id");
						HX_STACK_LINE(179)
						::String _file = _items->get(HX_CSTRING("file"))->__Field(HX_CSTRING("value"),true);		HX_STACK_VAR(_file,"_file");
						HX_STACK_LINE(182)
						if (((_file.indexOf(HX_CSTRING("\""),null()) != (int)-1))){
							HX_STACK_LINE(183)
							_file = ::StringTools_obj::replace(_file,HX_CSTRING("\""),HX_CSTRING(""));
						}
						HX_STACK_LINE(187)
						_file = ::StringTools_obj::trim(_file);
						struct _Function_5_1{
							inline static Dynamic Block( ::String &_file,Dynamic &_id){
								HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/BitmapFont.hx",190,0xdfcf0e40)
								{
									hx::Anon __result = hx::Anon_obj::Create();
									__result->Add(HX_CSTRING("id") , _id,false);
									__result->Add(HX_CSTRING("file") , _file,false);
									return __result;
								}
								return null();
							}
						};
						HX_STACK_LINE(190)
						_pages->__Field(HX_CSTRING("push"),true)(_Function_5_1::Block(_file,_id));
						HX_STACK_LINE(192)
						this->pages->set(_id,null());
					}
					else if (  ( _switch_1==HX_CSTRING("chars"))){
						HX_STACK_LINE(196)
						_initial_tokens->remove(HX_CSTRING("chars"));
						HX_STACK_LINE(197)
						::haxe::ds::StringMap _items = this->_tokenize_font_line(_initial_tokens);		HX_STACK_VAR(_items,"_items");
						HX_STACK_LINE(200)
						this->font_character_count = ::Std_obj::parseInt(_items->get(HX_CSTRING("count"))->__Field(HX_CSTRING("value"),true));
					}
					else if (  ( _switch_1==HX_CSTRING("char"))){
						HX_STACK_LINE(204)
						_initial_tokens->remove(HX_CSTRING("char"));
						HX_STACK_LINE(205)
						::haxe::ds::StringMap _items = this->_tokenize_font_line(_initial_tokens);		HX_STACK_VAR(_items,"_items");
						HX_STACK_LINE(209)
						Dynamic _g2 = ::Std_obj::parseInt(_items->get(HX_CSTRING("id"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_g2,"_g2");
						HX_STACK_LINE(210)
						Float _g12 = ::Std_obj::parseFloat(_items->get(HX_CSTRING("x"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_g12,"_g12");
						HX_STACK_LINE(211)
						Float _g21 = ::Std_obj::parseFloat(_items->get(HX_CSTRING("y"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_g21,"_g21");
						HX_STACK_LINE(212)
						Float _g3 = ::Std_obj::parseFloat(_items->get(HX_CSTRING("width"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_g3,"_g3");
						HX_STACK_LINE(213)
						Float _g4 = ::Std_obj::parseFloat(_items->get(HX_CSTRING("height"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_g4,"_g4");
						HX_STACK_LINE(214)
						Float _g5 = ::Std_obj::parseFloat(_items->get(HX_CSTRING("xoffset"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_g5,"_g5");
						HX_STACK_LINE(215)
						Float _g6 = ::Std_obj::parseFloat(_items->get(HX_CSTRING("yoffset"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_g6,"_g6");
						HX_STACK_LINE(216)
						Float _g7 = ::Std_obj::parseFloat(_items->get(HX_CSTRING("xadvance"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(_g7,"_g7");
						struct _Function_5_1{
							inline static Dynamic Block( Float &_g7,Float &_g5,Float &_g12,Float &_g6,Float &_g4,::haxe::ds::StringMap &_items,Dynamic &_g2,Float &_g3,Float &_g21){
								HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/BitmapFont.hx",208,0xdfcf0e40)
								{
									hx::Anon __result = hx::Anon_obj::Create();
									__result->Add(HX_CSTRING("id") , _g2,false);
									__result->Add(HX_CSTRING("x") , _g12,false);
									__result->Add(HX_CSTRING("y") , _g21,false);
									__result->Add(HX_CSTRING("width") , _g3,false);
									__result->Add(HX_CSTRING("height") , _g4,false);
									__result->Add(HX_CSTRING("xoffset") , _g5,false);
									__result->Add(HX_CSTRING("yoffset") , _g6,false);
									__result->Add(HX_CSTRING("xadvance") , _g7,false);
									__result->Add(HX_CSTRING("page") , ::Std_obj::parseInt(_items->get(HX_CSTRING("page"))->__Field(HX_CSTRING("value"),true)),false);
									return __result;
								}
								return null();
							}
						};
						HX_STACK_LINE(208)
						Dynamic _character_info = _Function_5_1::Block(_g7,_g5,_g12,_g6,_g4,_items,_g2,_g3,_g21);		HX_STACK_VAR(_character_info,"_character_info");
						HX_STACK_LINE(220)
						this->set_character(_character_info->__Field(HX_CSTRING("id"),true),_character_info);
					}
					else if (  ( _switch_1==HX_CSTRING("kerning"))){
						HX_STACK_LINE(224)
						_initial_tokens->remove(HX_CSTRING("char"));
						HX_STACK_LINE(225)
						::haxe::ds::StringMap _items = this->_tokenize_font_line(_initial_tokens);		HX_STACK_VAR(_items,"_items");
						HX_STACK_LINE(227)
						Dynamic first = ::Std_obj::parseInt(_items->get(HX_CSTRING("first"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(first,"first");
						HX_STACK_LINE(228)
						Dynamic second = ::Std_obj::parseInt(_items->get(HX_CSTRING("second"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(second,"second");
						HX_STACK_LINE(229)
						Float amount = ::Std_obj::parseFloat(_items->get(HX_CSTRING("amount"))->__Field(HX_CSTRING("value"),true));		HX_STACK_VAR(amount,"amount");
						HX_STACK_LINE(231)
						this->set_kerning(first,second,amount);
					}
				}
			}
		}
		HX_STACK_LINE(238)
		if (((custom_pages == null()))){
			HX_STACK_LINE(240)
			int _g = (int)0;		HX_STACK_VAR(_g,"_g");
			HX_STACK_LINE(240)
			while(((_g < _pages->__Field(HX_CSTRING("length"),true)))){
				HX_STACK_LINE(240)
				Dynamic _page_item = Dynamic( Array_obj<Dynamic>::__new().Add(_pages->__GetItem(_g)));		HX_STACK_VAR(_page_item,"_page_item");
				HX_STACK_LINE(240)
				++(_g);
				HX_STACK_LINE(242)
				Array< ::Dynamic > _t = Array_obj< ::Dynamic >::__new().Add(::Luxe_obj::loadTexture((_folder + _page_item->__GetItem((int)0)->__Field(HX_CSTRING("file"),true)),this->one_page_loaded_dyn(),null()));		HX_STACK_VAR(_t,"_t");

				HX_BEGIN_LOCAL_FUNC_S3(hx::LocalFunc,_Function_3_1,Array< ::Dynamic >,_g1,Array< ::Dynamic >,_t,Dynamic,_page_item)
				Void run(::phoenix::Texture t_t){
					HX_STACK_FRAME("*","_Function_3_1",0x520271b9,"*._Function_3_1","phoenix/BitmapFont.hx",244,0xdfcf0e40)
					HX_STACK_ARG(t_t,"t_t")
					{
						HX_STACK_LINE(245)
						_g1->__get((int)0).StaticCast< ::phoenix::BitmapFont >()->pages->set(_page_item->__GetItem((int)0)->__Field(HX_CSTRING("id"),true),_t->__get((int)0).StaticCast< ::phoenix::Texture >());
						HX_STACK_LINE(247)
						_t->__get((int)0).StaticCast< ::phoenix::Texture >()->set_filter_min(::phoenix::FilterType_obj::linear);
					}
					return null();
				}
				HX_END_LOCAL_FUNC1((void))

				HX_STACK_LINE(244)
				_t->__get((int)0).StaticCast< ::phoenix::Texture >()->set_onload( Dynamic(new _Function_3_1(_g1,_t,_page_item)));
			}
		}
		else{
			HX_STACK_LINE(255)
			int _id = (int)0;		HX_STACK_VAR(_id,"_id");
			HX_STACK_LINE(257)
			{
				HX_STACK_LINE(257)
				int _g = (int)0;		HX_STACK_VAR(_g,"_g");
				HX_STACK_LINE(257)
				while(((_g < custom_pages->length))){
					HX_STACK_LINE(257)
					::phoenix::Texture _page = custom_pages->__get(_g).StaticCast< ::phoenix::Texture >();		HX_STACK_VAR(_page,"_page");
					HX_STACK_LINE(257)
					++(_g);
					HX_STACK_LINE(258)
					this->pages->set(_id,_page);
					HX_STACK_LINE(259)
					++(_id);
				}
			}
			HX_STACK_LINE(263)
			this->on_all_pages_loaded();
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC4(BitmapFont_obj,from_string,(void))

Void BitmapFont_obj::set_kerning( int _glyph,int _index,Float _amount){
{
		HX_STACK_FRAME("phoenix.BitmapFont","set_kerning",0x96a5bffe,"phoenix.BitmapFont.set_kerning","phoenix/BitmapFont.hx",270,0xdfcf0e40)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_glyph,"_glyph")
		HX_STACK_ARG(_index,"_index")
		HX_STACK_ARG(_amount,"_amount")
		struct _Function_1_1{
			inline static Dynamic Block( int &_index,int &_glyph){
				HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/BitmapFont.hx",270,0xdfcf0e40)
				{
					hx::Anon __result = hx::Anon_obj::Create();
					__result->Add(HX_CSTRING("glyph") , _glyph,false);
					__result->Add(HX_CSTRING("index") , _index,false);
					return __result;
				}
				return null();
			}
		};
		HX_STACK_LINE(270)
		this->kernings->set(_Function_1_1::Block(_index,_glyph),_amount);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(BitmapFont_obj,set_kerning,(void))

Dynamic BitmapFont_obj::get_kerning( int _glyph,int _index){
	HX_STACK_FRAME("phoenix.BitmapFont","get_kerning",0x8c38b8f2,"phoenix.BitmapFont.get_kerning","phoenix/BitmapFont.hx",273,0xdfcf0e40)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_glyph,"_glyph")
	HX_STACK_ARG(_index,"_index")
	struct _Function_1_1{
		inline static Dynamic Block( int &_index,int &_glyph){
			HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/BitmapFont.hx",274,0xdfcf0e40)
			{
				hx::Anon __result = hx::Anon_obj::Create();
				__result->Add(HX_CSTRING("glyph") , _glyph,false);
				__result->Add(HX_CSTRING("index") , _index,false);
				return __result;
			}
			return null();
		}
	};
	HX_STACK_LINE(274)
	Dynamic key = _Function_1_1::Block(_index,_glyph);		HX_STACK_VAR(key,"key");
	HX_STACK_LINE(275)
	if ((this->kernings->__Internal->exists(::__hxcpp_obj_id(key)))){
		HX_STACK_LINE(276)
		return this->kernings->get(key);
	}
	else{
		HX_STACK_LINE(278)
		return (int)0;
	}
	HX_STACK_LINE(275)
	return 0.;
}


HX_DEFINE_DYNAMIC_FUNC2(BitmapFont_obj,get_kerning,return )

::phoenix::Vector BitmapFont_obj::get_text_dimensions( ::String _string,::phoenix::Vector _scale){
	HX_STACK_FRAME("phoenix.BitmapFont","get_text_dimensions",0x2e8ce805,"phoenix.BitmapFont.get_text_dimensions","phoenix/BitmapFont.hx",283,0xdfcf0e40)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_string,"_string")
	HX_STACK_ARG(_scale,"_scale")
	HX_STACK_LINE(287)
	this->line_widths->splice((int)0,this->line_widths->length);
	HX_STACK_LINE(290)
	Float cumulative_x = 0.0;		HX_STACK_VAR(cumulative_x,"cumulative_x");
	HX_STACK_LINE(291)
	Float cumulative_y = 0.0;		HX_STACK_VAR(cumulative_y,"cumulative_y");
	HX_STACK_LINE(292)
	Float max_x = 0.0;		HX_STACK_VAR(max_x,"max_x");
	HX_STACK_LINE(293)
	Dynamic spc;		HX_STACK_VAR(spc,"spc");
	HX_STACK_LINE(293)
	{
		HX_STACK_LINE(293)
		int key = HX_CSTRING(" ").charCodeAt((int)0);		HX_STACK_VAR(key,"key");
		HX_STACK_LINE(293)
		spc = this->characters->get(key);
	}
	HX_STACK_LINE(297)
	{
		HX_STACK_LINE(297)
		int _g1 = (int)0;		HX_STACK_VAR(_g1,"_g1");
		HX_STACK_LINE(297)
		int _g = _string.length;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(297)
		while(((_g1 < _g))){
			HX_STACK_LINE(297)
			int i = (_g1)++;		HX_STACK_VAR(i,"i");
			HX_STACK_LINE(299)
			::String glyph = _string.charAt(i);		HX_STACK_VAR(glyph,"glyph");
			HX_STACK_LINE(301)
			if (((glyph == HX_CSTRING("\n")))){
				HX_STACK_LINE(302)
				hx::AddEq(cumulative_y,(this->line_height * _scale->y));
				HX_STACK_LINE(303)
				max_x = ::Math_obj::max(max_x,cumulative_x);
				HX_STACK_LINE(304)
				this->line_widths->push(cumulative_x);
				HX_STACK_LINE(305)
				cumulative_x = (int)0;
				HX_STACK_LINE(306)
				continue;
			}
			HX_STACK_LINE(309)
			Dynamic c;		HX_STACK_VAR(c,"c");
			HX_STACK_LINE(309)
			{
				HX_STACK_LINE(309)
				int key = glyph.charCodeAt((int)0);		HX_STACK_VAR(key,"key");
				HX_STACK_LINE(309)
				c = this->characters->get(key);
			}
			HX_STACK_LINE(315)
			Float _x_advance = 0.0;		HX_STACK_VAR(_x_advance,"_x_advance");
			HX_STACK_LINE(316)
			if (((c != null()))){
				HX_STACK_LINE(317)
				_x_advance = c->__Field(HX_CSTRING("xadvance"),true);
			}
			HX_STACK_LINE(321)
			Float x_inc = _x_advance;		HX_STACK_VAR(x_inc,"x_inc");
			HX_STACK_LINE(322)
			if (((i < (_string.length - (int)1)))){
				HX_STACK_LINE(323)
				Dynamic _g2 = glyph.charCodeAt((int)0);		HX_STACK_VAR(_g2,"_g2");
				HX_STACK_LINE(323)
				hx::AddEq(x_inc,this->get_kerning(_g2,_string.charAt(i).charCodeAt((int)0)));
			}
			HX_STACK_LINE(326)
			if (((glyph == HX_CSTRING("\t")))){
				HX_STACK_LINE(327)
				hx::AddEq(x_inc,(spc->__Field(HX_CSTRING("xadvance"),true) * (int)4));
			}
			HX_STACK_LINE(330)
			hx::AddEq(cumulative_x,(x_inc * _scale->x));
		}
	}
	HX_STACK_LINE(335)
	this->line_widths->push(cumulative_x);
	HX_STACK_LINE(336)
	max_x = ::Math_obj::max(max_x,cumulative_x);
	HX_STACK_LINE(341)
	hx::AddEq(cumulative_y,(this->line_height * _scale->y));
	HX_STACK_LINE(343)
	return ::phoenix::Vector_obj::__new(max_x,cumulative_y,null(),null());
}


HX_DEFINE_DYNAMIC_FUNC2(BitmapFont_obj,get_text_dimensions,return )

::phoenix::geometry::CompositeGeometry BitmapFont_obj::draw_text( Dynamic options){
	HX_STACK_FRAME("phoenix.BitmapFont","draw_text",0xd8705a57,"phoenix.BitmapFont.draw_text","phoenix/BitmapFont.hx",347,0xdfcf0e40)
	HX_STACK_THIS(this)
	HX_STACK_ARG(options,"options")
	HX_STACK_LINE(349)
	::String _string;		HX_STACK_VAR(_string,"_string");
	HX_STACK_LINE(349)
	if (((options->__Field(HX_CSTRING("text"),true) == null()))){
		HX_STACK_LINE(349)
		_string = HX_CSTRING("");
	}
	else{
		HX_STACK_LINE(349)
		_string = ::Std_obj::string(options->__Field(HX_CSTRING("text"),true));
	}
	HX_STACK_LINE(350)
	::phoenix::Vector _pos;		HX_STACK_VAR(_pos,"_pos");
	HX_STACK_LINE(350)
	if (((options->__Field(HX_CSTRING("pos"),true) == null()))){
		HX_STACK_LINE(350)
		_pos = ::phoenix::Vector_obj::__new(null(),null(),null(),null());
	}
	else{
		HX_STACK_LINE(350)
		_pos = options->__Field(HX_CSTRING("pos"),true);
	}
	HX_STACK_LINE(351)
	::phoenix::Color _col;		HX_STACK_VAR(_col,"_col");
	HX_STACK_LINE(351)
	if (((options->__Field(HX_CSTRING("color"),true) == null()))){
		HX_STACK_LINE(351)
		_col = ::phoenix::Color_obj::__new(null(),null(),null(),null());
	}
	else{
		HX_STACK_LINE(351)
		_col = options->__Field(HX_CSTRING("color"),true);
	}
	HX_STACK_LINE(352)
	::phoenix::Rectangle _bounds;		HX_STACK_VAR(_bounds,"_bounds");
	HX_STACK_LINE(352)
	if (((options->__Field(HX_CSTRING("bounds"),true) == null()))){
		HX_STACK_LINE(352)
		_bounds = null();
	}
	else{
		HX_STACK_LINE(352)
		_bounds = options->__Field(HX_CSTRING("bounds"),true);
	}
	HX_STACK_LINE(353)
	::phoenix::TextAlign _align;		HX_STACK_VAR(_align,"_align");
	HX_STACK_LINE(353)
	if (((options->__Field(HX_CSTRING("align"),true) == null()))){
		HX_STACK_LINE(353)
		_align = ::phoenix::TextAlign_obj::left;
	}
	else{
		HX_STACK_LINE(353)
		_align = options->__Field(HX_CSTRING("align"),true);
	}
	HX_STACK_LINE(354)
	::phoenix::TextAlign _valign;		HX_STACK_VAR(_valign,"_valign");
	HX_STACK_LINE(354)
	if (((options->__Field(HX_CSTRING("align_vertical"),true) == null()))){
		HX_STACK_LINE(354)
		_valign = ::phoenix::TextAlign_obj::top;
	}
	else{
		HX_STACK_LINE(354)
		_valign = options->__Field(HX_CSTRING("align_vertical"),true);
	}
	HX_STACK_LINE(355)
	Float _depth;		HX_STACK_VAR(_depth,"_depth");
	HX_STACK_LINE(355)
	if (((options->__Field(HX_CSTRING("depth"),true) == null()))){
		HX_STACK_LINE(355)
		_depth = (int)0;
	}
	else{
		HX_STACK_LINE(355)
		_depth = options->__Field(HX_CSTRING("depth"),true);
	}
	HX_STACK_LINE(356)
	Float _size;		HX_STACK_VAR(_size,"_size");
	HX_STACK_LINE(356)
	if (((options->__Field(HX_CSTRING("size"),true) == null()))){
		HX_STACK_LINE(356)
		_size = (int)22;
	}
	else{
		HX_STACK_LINE(356)
		_size = options->__Field(HX_CSTRING("size"),true);
	}
	HX_STACK_LINE(357)
	::phoenix::Batcher _batcher;		HX_STACK_VAR(_batcher,"_batcher");
	HX_STACK_LINE(357)
	if (((options->__Field(HX_CSTRING("batcher"),true) == null()))){
		HX_STACK_LINE(357)
		_batcher = ::Luxe_obj::renderer->batcher;
	}
	else{
		HX_STACK_LINE(357)
		_batcher = options->__Field(HX_CSTRING("batcher"),true);
	}
	HX_STACK_LINE(358)
	bool _visible;		HX_STACK_VAR(_visible,"_visible");
	HX_STACK_LINE(358)
	if (((options->__Field(HX_CSTRING("visible"),true) == null()))){
		HX_STACK_LINE(358)
		_visible = true;
	}
	else{
		HX_STACK_LINE(358)
		_visible = options->__Field(HX_CSTRING("visible"),true);
	}
	HX_STACK_LINE(359)
	bool _immediate;		HX_STACK_VAR(_immediate,"_immediate");
	HX_STACK_LINE(359)
	if (((options->__Field(HX_CSTRING("immediate"),true) == null()))){
		HX_STACK_LINE(359)
		_immediate = false;
	}
	else{
		HX_STACK_LINE(359)
		_immediate = options->__Field(HX_CSTRING("immediate"),true);
	}
	HX_STACK_LINE(360)
	::phoenix::geometry::CompositeGeometry _final_geom;		HX_STACK_VAR(_final_geom,"_final_geom");
	HX_STACK_LINE(360)
	if (((options->__Field(HX_CSTRING("geometry"),true) == null()))){
		HX_STACK_LINE(360)
		_final_geom = ::phoenix::geometry::CompositeGeometry_obj::__new(null());
	}
	else{
		HX_STACK_LINE(360)
		_final_geom = options->__Field(HX_CSTRING("geometry"),true);
	}
	HX_STACK_LINE(362)
	bool _bounds_based = false;		HX_STACK_VAR(_bounds_based,"_bounds_based");
	HX_STACK_LINE(363)
	if (((_bounds != null()))){
		HX_STACK_LINE(364)
		_bounds_based = true;
	}
	HX_STACK_LINE(368)
	if (((this->pages->get((int)0) == null()))){
		HX_STACK_LINE(369)
		::haxe::Log_obj::trace((HX_CSTRING("i / bitmapfont / ") + (((HX_CSTRING("Warning ; ") + this->id) + HX_CSTRING(" font trying to draw without a texture.")))),hx::SourceInfo(HX_CSTRING("BitmapFont.hx"),369,HX_CSTRING("phoenix.BitmapFont"),HX_CSTRING("draw_text")));
		HX_STACK_LINE(370)
		return _final_geom;
	}
	HX_STACK_LINE(374)
	Array< ::Dynamic > _geoms = Array_obj< ::Dynamic >::__new();		HX_STACK_VAR(_geoms,"_geoms");
	HX_STACK_LINE(375)
	int _page_count = ::Lambda_obj::count(this->pages,null());		HX_STACK_VAR(_page_count,"_page_count");
	HX_STACK_LINE(379)
	{
		HX_STACK_LINE(379)
		int _g = (int)0;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(379)
		while(((_g < _page_count))){
			HX_STACK_LINE(379)
			int i = (_g)++;		HX_STACK_VAR(i,"i");
			struct _Function_3_1{
				inline static Dynamic Block( int &i,::phoenix::BitmapFont_obj *__this,::phoenix::Color &_col,Float &_depth,bool &_visible,bool &_immediate){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/BitmapFont.hx",381,0xdfcf0e40)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("texture") , __this->pages->get(i),false);
						__result->Add(HX_CSTRING("color") , _col,false);
						__result->Add(HX_CSTRING("depth") , _depth,false);
						__result->Add(HX_CSTRING("visible") , _visible,false);
						__result->Add(HX_CSTRING("immediate") , _immediate,false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(381)
			::phoenix::geometry::Geometry _g1 = ::phoenix::geometry::Geometry_obj::__new(_Function_3_1::Block(i,this,_col,_depth,_visible,_immediate));		HX_STACK_VAR(_g1,"_g1");
			HX_STACK_LINE(389)
			_g1->id = (((HX_CSTRING("text.page") + i) + HX_CSTRING(".")) + _string);
			HX_STACK_LINE(391)
			_g1->set_primitive_type(::phoenix::PrimitiveType_obj::triangles);
			HX_STACK_LINE(392)
			_g1->immediate = _immediate;
			HX_STACK_LINE(393)
			_geoms->push(_g1);
		}
	}
	HX_STACK_LINE(398)
	Float point_size = (Float(_size) / Float(this->font_size));		HX_STACK_VAR(point_size,"point_size");
	HX_STACK_LINE(400)
	::phoenix::Vector _scale = ::phoenix::Vector_obj::__new(point_size,point_size,null(),null());		HX_STACK_VAR(_scale,"_scale");
	HX_STACK_LINE(402)
	if ((!(_immediate))){
	}
	HX_STACK_LINE(406)
	Float _cumulative_x = 0.0;		HX_STACK_VAR(_cumulative_x,"_cumulative_x");
	HX_STACK_LINE(407)
	Float _cumulative_y = 0.0;		HX_STACK_VAR(_cumulative_y,"_cumulative_y");
	HX_STACK_LINE(410)
	Dynamic spc;		HX_STACK_VAR(spc,"spc");
	HX_STACK_LINE(410)
	{
		HX_STACK_LINE(410)
		int key = HX_CSTRING(" ").charCodeAt((int)0);		HX_STACK_VAR(key,"key");
		HX_STACK_LINE(410)
		spc = this->characters->get(key);
	}
	HX_STACK_LINE(412)
	int _line_number = (int)0;		HX_STACK_VAR(_line_number,"_line_number");
	HX_STACK_LINE(413)
	::phoenix::Vector _dimensions = this->get_text_dimensions(_string,_scale);		HX_STACK_VAR(_dimensions,"_dimensions");
	HX_STACK_LINE(414)
	Float _max_line_width = _dimensions->x;		HX_STACK_VAR(_max_line_width,"_max_line_width");
	HX_STACK_LINE(416)
	Array< ::String > _lines = _string.split(HX_CSTRING("\n"));		HX_STACK_VAR(_lines,"_lines");
	HX_STACK_LINE(418)
	{
		HX_STACK_LINE(418)
		int _g = (int)0;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(418)
		while(((_g < _lines->length))){
			HX_STACK_LINE(418)
			::String _line = _lines->__get(_g);		HX_STACK_VAR(_line,"_line");
			HX_STACK_LINE(418)
			++(_g);
			HX_STACK_LINE(420)
			Float _align_x_offset = 0.0;		HX_STACK_VAR(_align_x_offset,"_align_x_offset");
			HX_STACK_LINE(424)
			if (((_align == ::phoenix::TextAlign_obj::center))){
				HX_STACK_LINE(425)
				_align_x_offset = ((Float(_max_line_width) / Float(2.0)) - (Float(this->line_widths->__get(_line_number)) / Float(2.0)));
			}
			else{
				HX_STACK_LINE(427)
				if (((_align == ::phoenix::TextAlign_obj::right))){
					HX_STACK_LINE(428)
					_align_x_offset = (_max_line_width - this->line_widths->__get(_line_number));
				}
			}
			HX_STACK_LINE(432)
			if (((_line_number != (int)0))){
				HX_STACK_LINE(433)
				hx::AddEq(_cumulative_y,(this->line_height * _scale->y));
				HX_STACK_LINE(434)
				_cumulative_x = (int)0;
			}
			HX_STACK_LINE(437)
			{
				HX_STACK_LINE(437)
				int _g2 = (int)0;		HX_STACK_VAR(_g2,"_g2");
				HX_STACK_LINE(437)
				int _g1 = _line.length;		HX_STACK_VAR(_g1,"_g1");
				HX_STACK_LINE(437)
				while(((_g2 < _g1))){
					HX_STACK_LINE(437)
					int i = (_g2)++;		HX_STACK_VAR(i,"i");
					HX_STACK_LINE(439)
					::String _char = _line.charAt(i);		HX_STACK_VAR(_char,"_char");
					HX_STACK_LINE(440)
					Dynamic c;		HX_STACK_VAR(c,"c");
					HX_STACK_LINE(440)
					{
						HX_STACK_LINE(440)
						int key = _char.charCodeAt((int)0);		HX_STACK_VAR(key,"key");
						HX_STACK_LINE(440)
						c = this->characters->get(key);
					}
					HX_STACK_LINE(442)
					if (((c == null()))){
						HX_STACK_LINE(445)
						c = spc;
					}
					HX_STACK_LINE(449)
					::phoenix::geometry::Geometry _geom = _geoms->__get(c->__Field(HX_CSTRING("page"),true)).StaticCast< ::phoenix::geometry::Geometry >();		HX_STACK_VAR(_geom,"_geom");
					HX_STACK_LINE(452)
					int _tw = this->pages->get(c->__Field(HX_CSTRING("page"),true))->__Field(HX_CSTRING("width_actual"),true);		HX_STACK_VAR(_tw,"_tw");
					HX_STACK_LINE(453)
					int _th = this->pages->get(c->__Field(HX_CSTRING("page"),true))->__Field(HX_CSTRING("height_actual"),true);		HX_STACK_VAR(_th,"_th");
					HX_STACK_LINE(456)
					Float _u = (Float(c->__Field(HX_CSTRING("x"),true)) / Float(_tw));		HX_STACK_VAR(_u,"_u");
					HX_STACK_LINE(457)
					Float _v = (Float(c->__Field(HX_CSTRING("y"),true)) / Float(_th));		HX_STACK_VAR(_v,"_v");
					HX_STACK_LINE(458)
					Float _u2 = (Float(((c->__Field(HX_CSTRING("x"),true) + c->__Field(HX_CSTRING("width"),true)))) / Float(_tw));		HX_STACK_VAR(_u2,"_u2");
					HX_STACK_LINE(459)
					Float _v2 = (Float(((c->__Field(HX_CSTRING("y"),true) + c->__Field(HX_CSTRING("height"),true)))) / Float(_th));		HX_STACK_VAR(_v2,"_v2");
					HX_STACK_LINE(460)
					Float _x = ((_align_x_offset + _cumulative_x) + (c->__Field(HX_CSTRING("xoffset"),true) * _scale->x));		HX_STACK_VAR(_x,"_x");
					HX_STACK_LINE(461)
					Float _y = (_cumulative_y + (c->__Field(HX_CSTRING("yoffset"),true) * _scale->y));		HX_STACK_VAR(_y,"_y");
					HX_STACK_LINE(462)
					Float _w = (c->__Field(HX_CSTRING("width"),true) * _scale->x);		HX_STACK_VAR(_w,"_w");
					HX_STACK_LINE(463)
					Float _h = (c->__Field(HX_CSTRING("height"),true) * _scale->y);		HX_STACK_VAR(_h,"_h");
					HX_STACK_LINE(465)
					Float _x_inc = c->__Field(HX_CSTRING("xadvance"),true);		HX_STACK_VAR(_x_inc,"_x_inc");
					HX_STACK_LINE(466)
					if (((i < (_line.length - (int)1)))){
						HX_STACK_LINE(467)
						hx::AddEq(_x_inc,this->get_kerning(c->__Field(HX_CSTRING("id"),true),_char.charCodeAt((int)0)));
					}
					HX_STACK_LINE(470)
					if (((_char == HX_CSTRING("\t")))){
						HX_STACK_LINE(471)
						hx::AddEq(_x_inc,(spc->__Field(HX_CSTRING("xadvance"),true) * (int)4));
					}
					HX_STACK_LINE(474)
					hx::AddEq(_cumulative_x,(_x_inc * _scale->x));
					HX_STACK_LINE(481)
					::phoenix::geometry::Vertex vert0 = ::phoenix::geometry::Vertex_obj::__new(::phoenix::Vector_obj::__new(_x,_y,null(),null()),_col,null());		HX_STACK_VAR(vert0,"vert0");
					HX_STACK_LINE(482)
					vert0->uv->uv0->set(_u,_v,null(),null());
					HX_STACK_LINE(484)
					::phoenix::geometry::Vertex vert1 = ::phoenix::geometry::Vertex_obj::__new(::phoenix::Vector_obj::__new((_x + _w),_y,null(),null()),_col,null());		HX_STACK_VAR(vert1,"vert1");
					HX_STACK_LINE(485)
					vert1->uv->uv0->set(_u2,_v,null(),null());
					HX_STACK_LINE(487)
					::phoenix::geometry::Vertex vert2 = ::phoenix::geometry::Vertex_obj::__new(::phoenix::Vector_obj::__new((_x + _w),(_y + _h),null(),null()),_col,null());		HX_STACK_VAR(vert2,"vert2");
					HX_STACK_LINE(488)
					vert2->uv->uv0->set(_u2,_v2,null(),null());
					HX_STACK_LINE(492)
					::phoenix::geometry::Vertex vert3 = ::phoenix::geometry::Vertex_obj::__new(::phoenix::Vector_obj::__new(_x,(_y + _h),null(),null()),_col,null());		HX_STACK_VAR(vert3,"vert3");
					HX_STACK_LINE(493)
					vert3->uv->uv0->set(_u,_v2,null(),null());
					HX_STACK_LINE(495)
					::phoenix::geometry::Vertex vert4 = ::phoenix::geometry::Vertex_obj::__new(::phoenix::Vector_obj::__new(_x,_y,null(),null()),_col,null());		HX_STACK_VAR(vert4,"vert4");
					HX_STACK_LINE(496)
					vert4->uv->uv0->set(_u,_v,null(),null());
					HX_STACK_LINE(498)
					::phoenix::geometry::Vertex vert5 = ::phoenix::geometry::Vertex_obj::__new(::phoenix::Vector_obj::__new((_x + _w),(_y + _h),null(),null()),_col,null());		HX_STACK_VAR(vert5,"vert5");
					HX_STACK_LINE(499)
					vert5->uv->uv0->set(_u2,_v2,null(),null());
					HX_STACK_LINE(503)
					_geom->add(vert0);
					HX_STACK_LINE(503)
					_geom->add(vert1);
					HX_STACK_LINE(503)
					_geom->add(vert2);
					HX_STACK_LINE(504)
					_geom->add(vert3);
					HX_STACK_LINE(504)
					_geom->add(vert4);
					HX_STACK_LINE(504)
					_geom->add(vert5);
				}
			}
			HX_STACK_LINE(509)
			(_line_number)++;
		}
	}
	HX_STACK_LINE(514)
	_final_geom->replace(_geoms);
	HX_STACK_LINE(515)
	_final_geom->add_to_batcher(_batcher);
	HX_STACK_LINE(517)
	if ((!(_bounds_based))){
		HX_STACK_LINE(520)
		::phoenix::Vector _po = _pos->clone();		HX_STACK_VAR(_po,"_po");
		HX_STACK_LINE(522)
		if (((_align == ::phoenix::TextAlign_obj::center))){
			HX_STACK_LINE(523)
			_po->set_x((_pos->x - (Float(_max_line_width) / Float((int)2))));
		}
		else{
			HX_STACK_LINE(524)
			if (((_align == ::phoenix::TextAlign_obj::right))){
				HX_STACK_LINE(525)
				_po->set_x((_pos->x - _max_line_width));
			}
		}
		HX_STACK_LINE(528)
		_final_geom->transform->set_origin(::phoenix::Vector_obj::__new((_pos->x - _po->x),(_pos->y - _po->y),null(),null()));
		HX_STACK_LINE(529)
		_final_geom->transform->set_pos(_pos->clone());
	}
	else{
		HX_STACK_LINE(534)
		::phoenix::Vector _po = ::phoenix::Vector_obj::__new(_bounds->x,_bounds->y,null(),null());		HX_STACK_VAR(_po,"_po");
		HX_STACK_LINE(536)
		if (((_align == ::phoenix::TextAlign_obj::center))){
			HX_STACK_LINE(537)
			_po->set_x((_po->x + (((Float(_bounds->w) / Float((int)2)) - (Float(_dimensions->x) / Float((int)2))))));
		}
		else{
			HX_STACK_LINE(538)
			if (((_align == ::phoenix::TextAlign_obj::right))){
				HX_STACK_LINE(539)
				_po->set_x((_po->x + ((_bounds->w - _dimensions->x))));
			}
		}
		HX_STACK_LINE(542)
		if (((_valign == ::phoenix::TextAlign_obj::center))){
			HX_STACK_LINE(543)
			_po->set_y((_po->y + (((Float(_bounds->h) / Float((int)2)) - (Float(_dimensions->y) / Float((int)2))))));
		}
		else{
			HX_STACK_LINE(544)
			if (((_valign == ::phoenix::TextAlign_obj::bottom))){
				HX_STACK_LINE(545)
				_po->set_y((_po->y + ((_bounds->h - _dimensions->y))));
			}
		}
		HX_STACK_LINE(548)
		_final_geom->transform->set_origin(::phoenix::Vector_obj::__new((_pos->x - _po->x),(_pos->y - _po->y),null(),null()));
		HX_STACK_LINE(549)
		_final_geom->transform->set_pos(_pos->clone());
	}
	HX_STACK_LINE(556)
	_final_geom->id = (HX_CSTRING("drawn_text- ") + _string.substr((int)0,(int)10));
	HX_STACK_LINE(558)
	_final_geom->immediate = _immediate;
	HX_STACK_LINE(559)
	_final_geom->set_visible(_visible);
	HX_STACK_LINE(561)
	return _final_geom;
}


HX_DEFINE_DYNAMIC_FUNC1(BitmapFont_obj,draw_text,return )

Void BitmapFont_obj::set_character( int _index,Dynamic _char_info){
{
		HX_STACK_FRAME("phoenix.BitmapFont","set_character",0x23b1115b,"phoenix.BitmapFont.set_character","phoenix/BitmapFont.hx",566,0xdfcf0e40)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_index,"_index")
		HX_STACK_ARG(_char_info,"_char_info")
		HX_STACK_LINE(566)
		this->characters->set(_index,_char_info);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(BitmapFont_obj,set_character,(void))

::phoenix::BitmapFont BitmapFont_obj::load( ::String _fontid,::String __o__path,Dynamic _onloaded){
::String _path = __o__path.Default(HX_CSTRING("assets/"));
	HX_STACK_FRAME("phoenix.BitmapFont","load",0xf7cd5037,"phoenix.BitmapFont.load","phoenix/BitmapFont.hx",97,0xdfcf0e40)
	HX_STACK_ARG(_fontid,"_fontid")
	HX_STACK_ARG(_path,"_path")
	HX_STACK_ARG(_onloaded,"_onloaded")
{
		HX_STACK_LINE(100)
		::phoenix::BitmapFont new_font = ::phoenix::BitmapFont_obj::__new(::Luxe_obj::resources);		HX_STACK_VAR(new_font,"new_font");
		HX_STACK_LINE(101)
		::luxe::resource::TextResource font_data = ::Luxe_obj::loadText(::haxe::io::Path_obj::join(Array_obj< ::String >::__new().Add(_path).Add(_fontid)),null());		HX_STACK_VAR(font_data,"font_data");
		HX_STACK_LINE(103)
		new_font->from_string(font_data->text,_path,_onloaded,null());
		HX_STACK_LINE(105)
		::Luxe_obj::resources->cache(new_font);
		HX_STACK_LINE(107)
		return new_font;
	}
}


STATIC_HX_DEFINE_DYNAMIC_FUNC3(BitmapFont_obj,load,return )


BitmapFont_obj::BitmapFont_obj()
{
}

void BitmapFont_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(BitmapFont);
	HX_MARK_MEMBER_NAME(dimensions,"dimensions");
	HX_MARK_MEMBER_NAME(spacing,"spacing");
	HX_MARK_MEMBER_NAME(line_height,"line_height");
	HX_MARK_MEMBER_NAME(font_size,"font_size");
	HX_MARK_MEMBER_NAME(font_character_count,"font_character_count");
	HX_MARK_MEMBER_NAME(pages,"pages");
	HX_MARK_MEMBER_NAME(characters,"characters");
	HX_MARK_MEMBER_NAME(kernings,"kernings");
	HX_MARK_MEMBER_NAME(scale,"scale");
	HX_MARK_MEMBER_NAME(on_pages_loaded,"on_pages_loaded");
	HX_MARK_MEMBER_NAME(pages_loaded,"pages_loaded");
	HX_MARK_MEMBER_NAME(onload,"onload");
	HX_MARK_MEMBER_NAME(line_widths,"line_widths");
	::luxe::resource::Resource_obj::__Mark(HX_MARK_ARG);
	HX_MARK_END_CLASS();
}

void BitmapFont_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(dimensions,"dimensions");
	HX_VISIT_MEMBER_NAME(spacing,"spacing");
	HX_VISIT_MEMBER_NAME(line_height,"line_height");
	HX_VISIT_MEMBER_NAME(font_size,"font_size");
	HX_VISIT_MEMBER_NAME(font_character_count,"font_character_count");
	HX_VISIT_MEMBER_NAME(pages,"pages");
	HX_VISIT_MEMBER_NAME(characters,"characters");
	HX_VISIT_MEMBER_NAME(kernings,"kernings");
	HX_VISIT_MEMBER_NAME(scale,"scale");
	HX_VISIT_MEMBER_NAME(on_pages_loaded,"on_pages_loaded");
	HX_VISIT_MEMBER_NAME(pages_loaded,"pages_loaded");
	HX_VISIT_MEMBER_NAME(onload,"onload");
	HX_VISIT_MEMBER_NAME(line_widths,"line_widths");
	::luxe::resource::Resource_obj::__Visit(HX_VISIT_ARG);
}

Dynamic BitmapFont_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"load") ) { return load_dyn(); }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"pages") ) { return pages; }
		if (HX_FIELD_EQ(inName,"scale") ) { return scale; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"onload") ) { return onload; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"spacing") ) { return spacing; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"kernings") ) { return kernings; }
		if (HX_FIELD_EQ(inName,"toString") ) { return toString_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"font_size") ) { return font_size; }
		if (HX_FIELD_EQ(inName,"draw_text") ) { return draw_text_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"dimensions") ) { return dimensions; }
		if (HX_FIELD_EQ(inName,"characters") ) { return characters; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"line_height") ) { return line_height; }
		if (HX_FIELD_EQ(inName,"line_widths") ) { return line_widths; }
		if (HX_FIELD_EQ(inName,"from_string") ) { return from_string_dyn(); }
		if (HX_FIELD_EQ(inName,"set_kerning") ) { return set_kerning_dyn(); }
		if (HX_FIELD_EQ(inName,"get_kerning") ) { return get_kerning_dyn(); }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"pages_loaded") ) { return pages_loaded; }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"set_character") ) { return set_character_dyn(); }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"on_pages_loaded") ) { return on_pages_loaded; }
		if (HX_FIELD_EQ(inName,"one_page_loaded") ) { return one_page_loaded_dyn(); }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"_tokenize_font_line") ) { return _tokenize_font_line_dyn(); }
		if (HX_FIELD_EQ(inName,"on_all_pages_loaded") ) { return on_all_pages_loaded_dyn(); }
		if (HX_FIELD_EQ(inName,"get_text_dimensions") ) { return get_text_dimensions_dyn(); }
		break;
	case 20:
		if (HX_FIELD_EQ(inName,"font_character_count") ) { return font_character_count; }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic BitmapFont_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 5:
		if (HX_FIELD_EQ(inName,"pages") ) { pages=inValue.Cast< ::haxe::ds::IntMap >(); return inValue; }
		if (HX_FIELD_EQ(inName,"scale") ) { scale=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"onload") ) { onload=inValue.Cast< Dynamic >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"spacing") ) { spacing=inValue.Cast< Float >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"kernings") ) { kernings=inValue.Cast< ::haxe::ds::ObjectMap >(); return inValue; }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"font_size") ) { font_size=inValue.Cast< Float >(); return inValue; }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"dimensions") ) { dimensions=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		if (HX_FIELD_EQ(inName,"characters") ) { characters=inValue.Cast< ::haxe::ds::IntMap >(); return inValue; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"line_height") ) { line_height=inValue.Cast< Float >(); return inValue; }
		if (HX_FIELD_EQ(inName,"line_widths") ) { line_widths=inValue.Cast< Array< Float > >(); return inValue; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"pages_loaded") ) { pages_loaded=inValue.Cast< int >(); return inValue; }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"on_pages_loaded") ) { on_pages_loaded=inValue.Cast< Dynamic >(); return inValue; }
		break;
	case 20:
		if (HX_FIELD_EQ(inName,"font_character_count") ) { font_character_count=inValue.Cast< int >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void BitmapFont_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("dimensions"));
	outFields->push(HX_CSTRING("spacing"));
	outFields->push(HX_CSTRING("line_height"));
	outFields->push(HX_CSTRING("font_size"));
	outFields->push(HX_CSTRING("font_character_count"));
	outFields->push(HX_CSTRING("pages"));
	outFields->push(HX_CSTRING("characters"));
	outFields->push(HX_CSTRING("kernings"));
	outFields->push(HX_CSTRING("scale"));
	outFields->push(HX_CSTRING("pages_loaded"));
	outFields->push(HX_CSTRING("line_widths"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	HX_CSTRING("load"),
	String(null()) };

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(BitmapFont_obj,dimensions),HX_CSTRING("dimensions")},
	{hx::fsFloat,(int)offsetof(BitmapFont_obj,spacing),HX_CSTRING("spacing")},
	{hx::fsFloat,(int)offsetof(BitmapFont_obj,line_height),HX_CSTRING("line_height")},
	{hx::fsFloat,(int)offsetof(BitmapFont_obj,font_size),HX_CSTRING("font_size")},
	{hx::fsInt,(int)offsetof(BitmapFont_obj,font_character_count),HX_CSTRING("font_character_count")},
	{hx::fsObject /*::haxe::ds::IntMap*/ ,(int)offsetof(BitmapFont_obj,pages),HX_CSTRING("pages")},
	{hx::fsObject /*::haxe::ds::IntMap*/ ,(int)offsetof(BitmapFont_obj,characters),HX_CSTRING("characters")},
	{hx::fsObject /*::haxe::ds::ObjectMap*/ ,(int)offsetof(BitmapFont_obj,kernings),HX_CSTRING("kernings")},
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(BitmapFont_obj,scale),HX_CSTRING("scale")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(BitmapFont_obj,on_pages_loaded),HX_CSTRING("on_pages_loaded")},
	{hx::fsInt,(int)offsetof(BitmapFont_obj,pages_loaded),HX_CSTRING("pages_loaded")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(BitmapFont_obj,onload),HX_CSTRING("onload")},
	{hx::fsObject /*Array< Float >*/ ,(int)offsetof(BitmapFont_obj,line_widths),HX_CSTRING("line_widths")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("dimensions"),
	HX_CSTRING("spacing"),
	HX_CSTRING("line_height"),
	HX_CSTRING("font_size"),
	HX_CSTRING("font_character_count"),
	HX_CSTRING("pages"),
	HX_CSTRING("characters"),
	HX_CSTRING("kernings"),
	HX_CSTRING("scale"),
	HX_CSTRING("on_pages_loaded"),
	HX_CSTRING("pages_loaded"),
	HX_CSTRING("onload"),
	HX_CSTRING("line_widths"),
	HX_CSTRING("toString"),
	HX_CSTRING("_tokenize_font_line"),
	HX_CSTRING("on_all_pages_loaded"),
	HX_CSTRING("one_page_loaded"),
	HX_CSTRING("from_string"),
	HX_CSTRING("set_kerning"),
	HX_CSTRING("get_kerning"),
	HX_CSTRING("get_text_dimensions"),
	HX_CSTRING("draw_text"),
	HX_CSTRING("set_character"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(BitmapFont_obj::__mClass,"__mClass");
};

#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(BitmapFont_obj::__mClass,"__mClass");
};

#endif

Class BitmapFont_obj::__mClass;

void BitmapFont_obj::__register()
{
	hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("phoenix.BitmapFont"), hx::TCanCast< BitmapFont_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
    , sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
    , sMemberStorageInfo
#endif
);
}

void BitmapFont_obj::__boot()
{
}

} // end namespace phoenix
