lua_Font.cpp 91 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "lua_Font.h"
  4. #include "Base.h"
  5. #include "Bundle.h"
  6. #include "FileSystem.h"
  7. #include "Font.h"
  8. #include "Game.h"
  9. #include "Ref.h"
  10. #include "lua_FontJustify.h"
  11. namespace gameplay
  12. {
  13. void luaRegister_Font()
  14. {
  15. const luaL_Reg lua_members[] =
  16. {
  17. {"addRef", lua_Font_addRef},
  18. {"createText", lua_Font_createText},
  19. {"drawText", lua_Font_drawText},
  20. {"finish", lua_Font_finish},
  21. {"getCharacterSpacing", lua_Font_getCharacterSpacing},
  22. {"getIndexAtLocation", lua_Font_getIndexAtLocation},
  23. {"getLocationAtIndex", lua_Font_getLocationAtIndex},
  24. {"getRefCount", lua_Font_getRefCount},
  25. {"getSize", lua_Font_getSize},
  26. {"getSpriteBatch", lua_Font_getSpriteBatch},
  27. {"measureText", lua_Font_measureText},
  28. {"release", lua_Font_release},
  29. {"setCharacterSpacing", lua_Font_setCharacterSpacing},
  30. {"start", lua_Font_start},
  31. {NULL, NULL}
  32. };
  33. const luaL_Reg lua_statics[] =
  34. {
  35. {"create", lua_Font_static_create},
  36. {"getJustify", lua_Font_static_getJustify},
  37. {NULL, NULL}
  38. };
  39. std::vector<std::string> scopePath;
  40. gameplay::ScriptUtil::registerClass("Font", lua_members, NULL, lua_Font__gc, lua_statics, scopePath);
  41. }
  42. static Font* getInstance(lua_State* state)
  43. {
  44. void* userdata = luaL_checkudata(state, 1, "Font");
  45. luaL_argcheck(state, userdata != NULL, 1, "'Font' expected.");
  46. return (Font*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
  47. }
  48. int lua_Font__gc(lua_State* state)
  49. {
  50. // Get the number of parameters.
  51. int paramCount = lua_gettop(state);
  52. // Attempt to match the parameters to a valid binding.
  53. switch (paramCount)
  54. {
  55. case 1:
  56. {
  57. if ((lua_type(state, 1) == LUA_TUSERDATA))
  58. {
  59. void* userdata = luaL_checkudata(state, 1, "Font");
  60. luaL_argcheck(state, userdata != NULL, 1, "'Font' expected.");
  61. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
  62. if (object->owns)
  63. {
  64. Font* instance = (Font*)object->instance;
  65. SAFE_RELEASE(instance);
  66. }
  67. return 0;
  68. }
  69. lua_pushstring(state, "lua_Font__gc - Failed to match the given parameters to a valid function signature.");
  70. lua_error(state);
  71. break;
  72. }
  73. default:
  74. {
  75. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  76. lua_error(state);
  77. break;
  78. }
  79. }
  80. return 0;
  81. }
  82. int lua_Font_addRef(lua_State* state)
  83. {
  84. // Get the number of parameters.
  85. int paramCount = lua_gettop(state);
  86. // Attempt to match the parameters to a valid binding.
  87. switch (paramCount)
  88. {
  89. case 1:
  90. {
  91. if ((lua_type(state, 1) == LUA_TUSERDATA))
  92. {
  93. Font* instance = getInstance(state);
  94. instance->addRef();
  95. return 0;
  96. }
  97. lua_pushstring(state, "lua_Font_addRef - Failed to match the given parameters to a valid function signature.");
  98. lua_error(state);
  99. break;
  100. }
  101. default:
  102. {
  103. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  104. lua_error(state);
  105. break;
  106. }
  107. }
  108. return 0;
  109. }
  110. int lua_Font_createText(lua_State* state)
  111. {
  112. // Get the number of parameters.
  113. int paramCount = lua_gettop(state);
  114. // Attempt to match the parameters to a valid binding.
  115. switch (paramCount)
  116. {
  117. case 4:
  118. {
  119. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  120. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  121. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  122. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL))
  123. {
  124. // Get parameter 1 off the stack.
  125. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  126. // Get parameter 2 off the stack.
  127. bool param2Valid;
  128. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  129. if (!param2Valid)
  130. {
  131. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  132. lua_error(state);
  133. }
  134. // Get parameter 3 off the stack.
  135. bool param3Valid;
  136. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  137. if (!param3Valid)
  138. {
  139. lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'.");
  140. lua_error(state);
  141. }
  142. Font* instance = getInstance(state);
  143. void* returnPtr = (void*)instance->createText(param1, *param2, *param3);
  144. if (returnPtr)
  145. {
  146. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  147. object->instance = returnPtr;
  148. object->owns = false;
  149. luaL_getmetatable(state, "FontText");
  150. lua_setmetatable(state, -2);
  151. }
  152. else
  153. {
  154. lua_pushnil(state);
  155. }
  156. return 1;
  157. }
  158. lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature.");
  159. lua_error(state);
  160. break;
  161. }
  162. case 5:
  163. {
  164. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  165. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  166. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  167. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  168. lua_type(state, 5) == LUA_TNUMBER)
  169. {
  170. // Get parameter 1 off the stack.
  171. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  172. // Get parameter 2 off the stack.
  173. bool param2Valid;
  174. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  175. if (!param2Valid)
  176. {
  177. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  178. lua_error(state);
  179. }
  180. // Get parameter 3 off the stack.
  181. bool param3Valid;
  182. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  183. if (!param3Valid)
  184. {
  185. lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'.");
  186. lua_error(state);
  187. }
  188. // Get parameter 4 off the stack.
  189. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  190. Font* instance = getInstance(state);
  191. void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4);
  192. if (returnPtr)
  193. {
  194. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  195. object->instance = returnPtr;
  196. object->owns = false;
  197. luaL_getmetatable(state, "FontText");
  198. lua_setmetatable(state, -2);
  199. }
  200. else
  201. {
  202. lua_pushnil(state);
  203. }
  204. return 1;
  205. }
  206. lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature.");
  207. lua_error(state);
  208. break;
  209. }
  210. case 6:
  211. {
  212. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  213. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  214. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  215. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  216. lua_type(state, 5) == LUA_TNUMBER &&
  217. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL))
  218. {
  219. // Get parameter 1 off the stack.
  220. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  221. // Get parameter 2 off the stack.
  222. bool param2Valid;
  223. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  224. if (!param2Valid)
  225. {
  226. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  227. lua_error(state);
  228. }
  229. // Get parameter 3 off the stack.
  230. bool param3Valid;
  231. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  232. if (!param3Valid)
  233. {
  234. lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'.");
  235. lua_error(state);
  236. }
  237. // Get parameter 4 off the stack.
  238. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  239. // Get parameter 5 off the stack.
  240. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  241. Font* instance = getInstance(state);
  242. void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5);
  243. if (returnPtr)
  244. {
  245. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  246. object->instance = returnPtr;
  247. object->owns = false;
  248. luaL_getmetatable(state, "FontText");
  249. lua_setmetatable(state, -2);
  250. }
  251. else
  252. {
  253. lua_pushnil(state);
  254. }
  255. return 1;
  256. }
  257. lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature.");
  258. lua_error(state);
  259. break;
  260. }
  261. case 7:
  262. {
  263. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  264. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  265. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  266. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  267. lua_type(state, 5) == LUA_TNUMBER &&
  268. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  269. lua_type(state, 7) == LUA_TBOOLEAN)
  270. {
  271. // Get parameter 1 off the stack.
  272. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  273. // Get parameter 2 off the stack.
  274. bool param2Valid;
  275. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  276. if (!param2Valid)
  277. {
  278. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  279. lua_error(state);
  280. }
  281. // Get parameter 3 off the stack.
  282. bool param3Valid;
  283. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  284. if (!param3Valid)
  285. {
  286. lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'.");
  287. lua_error(state);
  288. }
  289. // Get parameter 4 off the stack.
  290. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  291. // Get parameter 5 off the stack.
  292. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  293. // Get parameter 6 off the stack.
  294. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  295. Font* instance = getInstance(state);
  296. void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5, param6);
  297. if (returnPtr)
  298. {
  299. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  300. object->instance = returnPtr;
  301. object->owns = false;
  302. luaL_getmetatable(state, "FontText");
  303. lua_setmetatable(state, -2);
  304. }
  305. else
  306. {
  307. lua_pushnil(state);
  308. }
  309. return 1;
  310. }
  311. lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature.");
  312. lua_error(state);
  313. break;
  314. }
  315. case 8:
  316. {
  317. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  318. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  319. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  320. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  321. lua_type(state, 5) == LUA_TNUMBER &&
  322. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  323. lua_type(state, 7) == LUA_TBOOLEAN &&
  324. lua_type(state, 8) == LUA_TBOOLEAN)
  325. {
  326. // Get parameter 1 off the stack.
  327. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  328. // Get parameter 2 off the stack.
  329. bool param2Valid;
  330. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  331. if (!param2Valid)
  332. {
  333. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  334. lua_error(state);
  335. }
  336. // Get parameter 3 off the stack.
  337. bool param3Valid;
  338. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  339. if (!param3Valid)
  340. {
  341. lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'.");
  342. lua_error(state);
  343. }
  344. // Get parameter 4 off the stack.
  345. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  346. // Get parameter 5 off the stack.
  347. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  348. // Get parameter 6 off the stack.
  349. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  350. // Get parameter 7 off the stack.
  351. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  352. Font* instance = getInstance(state);
  353. void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5, param6, param7);
  354. if (returnPtr)
  355. {
  356. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  357. object->instance = returnPtr;
  358. object->owns = false;
  359. luaL_getmetatable(state, "FontText");
  360. lua_setmetatable(state, -2);
  361. }
  362. else
  363. {
  364. lua_pushnil(state);
  365. }
  366. return 1;
  367. }
  368. lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature.");
  369. lua_error(state);
  370. break;
  371. }
  372. case 9:
  373. {
  374. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  375. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  376. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  377. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  378. lua_type(state, 5) == LUA_TNUMBER &&
  379. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  380. lua_type(state, 7) == LUA_TBOOLEAN &&
  381. lua_type(state, 8) == LUA_TBOOLEAN &&
  382. (lua_type(state, 9) == LUA_TUSERDATA || lua_type(state, 9) == LUA_TTABLE || lua_type(state, 9) == LUA_TNIL))
  383. {
  384. // Get parameter 1 off the stack.
  385. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  386. // Get parameter 2 off the stack.
  387. bool param2Valid;
  388. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  389. if (!param2Valid)
  390. {
  391. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  392. lua_error(state);
  393. }
  394. // Get parameter 3 off the stack.
  395. bool param3Valid;
  396. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  397. if (!param3Valid)
  398. {
  399. lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector4'.");
  400. lua_error(state);
  401. }
  402. // Get parameter 4 off the stack.
  403. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  404. // Get parameter 5 off the stack.
  405. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  406. // Get parameter 6 off the stack.
  407. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  408. // Get parameter 7 off the stack.
  409. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  410. // Get parameter 8 off the stack.
  411. bool param8Valid;
  412. gameplay::ScriptUtil::LuaArray<Rectangle> param8 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(9, "Rectangle", false, &param8Valid);
  413. if (!param8Valid)
  414. {
  415. lua_pushstring(state, "Failed to convert parameter 8 to type 'Rectangle'.");
  416. lua_error(state);
  417. }
  418. Font* instance = getInstance(state);
  419. void* returnPtr = (void*)instance->createText(param1, *param2, *param3, param4, param5, param6, param7, param8);
  420. if (returnPtr)
  421. {
  422. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  423. object->instance = returnPtr;
  424. object->owns = false;
  425. luaL_getmetatable(state, "FontText");
  426. lua_setmetatable(state, -2);
  427. }
  428. else
  429. {
  430. lua_pushnil(state);
  431. }
  432. return 1;
  433. }
  434. lua_pushstring(state, "lua_Font_createText - Failed to match the given parameters to a valid function signature.");
  435. lua_error(state);
  436. break;
  437. }
  438. default:
  439. {
  440. lua_pushstring(state, "Invalid number of parameters (expected 4, 5, 6, 7, 8 or 9).");
  441. lua_error(state);
  442. break;
  443. }
  444. }
  445. return 0;
  446. }
  447. int lua_Font_drawText(lua_State* state)
  448. {
  449. // Get the number of parameters.
  450. int paramCount = lua_gettop(state);
  451. // Attempt to match the parameters to a valid binding.
  452. switch (paramCount)
  453. {
  454. case 2:
  455. {
  456. do
  457. {
  458. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  459. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  460. {
  461. // Get parameter 1 off the stack.
  462. bool param1Valid;
  463. gameplay::ScriptUtil::LuaArray<Font::Text> param1 = gameplay::ScriptUtil::getObjectPointer<Font::Text>(2, "FontText", false, &param1Valid);
  464. if (!param1Valid)
  465. break;
  466. Font* instance = getInstance(state);
  467. instance->drawText(param1);
  468. return 0;
  469. }
  470. } while (0);
  471. lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature.");
  472. lua_error(state);
  473. break;
  474. }
  475. case 4:
  476. {
  477. do
  478. {
  479. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  480. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  481. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  482. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL))
  483. {
  484. // Get parameter 1 off the stack.
  485. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  486. // Get parameter 2 off the stack.
  487. bool param2Valid;
  488. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  489. if (!param2Valid)
  490. break;
  491. // Get parameter 3 off the stack.
  492. bool param3Valid;
  493. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  494. if (!param3Valid)
  495. break;
  496. Font* instance = getInstance(state);
  497. instance->drawText(param1, *param2, *param3);
  498. return 0;
  499. }
  500. } while (0);
  501. lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature.");
  502. lua_error(state);
  503. break;
  504. }
  505. case 5:
  506. {
  507. do
  508. {
  509. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  510. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  511. lua_type(state, 3) == LUA_TNUMBER &&
  512. lua_type(state, 4) == LUA_TNUMBER &&
  513. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL))
  514. {
  515. // Get parameter 1 off the stack.
  516. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  517. // Get parameter 2 off the stack.
  518. int param2 = (int)luaL_checkint(state, 3);
  519. // Get parameter 3 off the stack.
  520. int param3 = (int)luaL_checkint(state, 4);
  521. // Get parameter 4 off the stack.
  522. bool param4Valid;
  523. gameplay::ScriptUtil::LuaArray<Vector4> param4 = gameplay::ScriptUtil::getObjectPointer<Vector4>(5, "Vector4", true, &param4Valid);
  524. if (!param4Valid)
  525. break;
  526. Font* instance = getInstance(state);
  527. instance->drawText(param1, param2, param3, *param4);
  528. return 0;
  529. }
  530. } while (0);
  531. do
  532. {
  533. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  534. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  535. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  536. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  537. lua_type(state, 5) == LUA_TNUMBER)
  538. {
  539. // Get parameter 1 off the stack.
  540. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  541. // Get parameter 2 off the stack.
  542. bool param2Valid;
  543. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  544. if (!param2Valid)
  545. break;
  546. // Get parameter 3 off the stack.
  547. bool param3Valid;
  548. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  549. if (!param3Valid)
  550. break;
  551. // Get parameter 4 off the stack.
  552. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  553. Font* instance = getInstance(state);
  554. instance->drawText(param1, *param2, *param3, param4);
  555. return 0;
  556. }
  557. } while (0);
  558. lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature.");
  559. lua_error(state);
  560. break;
  561. }
  562. case 6:
  563. {
  564. do
  565. {
  566. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  567. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  568. lua_type(state, 3) == LUA_TNUMBER &&
  569. lua_type(state, 4) == LUA_TNUMBER &&
  570. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) &&
  571. lua_type(state, 6) == LUA_TNUMBER)
  572. {
  573. // Get parameter 1 off the stack.
  574. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  575. // Get parameter 2 off the stack.
  576. int param2 = (int)luaL_checkint(state, 3);
  577. // Get parameter 3 off the stack.
  578. int param3 = (int)luaL_checkint(state, 4);
  579. // Get parameter 4 off the stack.
  580. bool param4Valid;
  581. gameplay::ScriptUtil::LuaArray<Vector4> param4 = gameplay::ScriptUtil::getObjectPointer<Vector4>(5, "Vector4", true, &param4Valid);
  582. if (!param4Valid)
  583. break;
  584. // Get parameter 5 off the stack.
  585. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6);
  586. Font* instance = getInstance(state);
  587. instance->drawText(param1, param2, param3, *param4, param5);
  588. return 0;
  589. }
  590. } while (0);
  591. do
  592. {
  593. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  594. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  595. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  596. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  597. lua_type(state, 5) == LUA_TNUMBER &&
  598. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL))
  599. {
  600. // Get parameter 1 off the stack.
  601. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  602. // Get parameter 2 off the stack.
  603. bool param2Valid;
  604. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  605. if (!param2Valid)
  606. break;
  607. // Get parameter 3 off the stack.
  608. bool param3Valid;
  609. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  610. if (!param3Valid)
  611. break;
  612. // Get parameter 4 off the stack.
  613. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  614. // Get parameter 5 off the stack.
  615. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  616. Font* instance = getInstance(state);
  617. instance->drawText(param1, *param2, *param3, param4, param5);
  618. return 0;
  619. }
  620. } while (0);
  621. lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature.");
  622. lua_error(state);
  623. break;
  624. }
  625. case 7:
  626. {
  627. do
  628. {
  629. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  630. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  631. lua_type(state, 3) == LUA_TNUMBER &&
  632. lua_type(state, 4) == LUA_TNUMBER &&
  633. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) &&
  634. lua_type(state, 6) == LUA_TNUMBER &&
  635. lua_type(state, 7) == LUA_TBOOLEAN)
  636. {
  637. // Get parameter 1 off the stack.
  638. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  639. // Get parameter 2 off the stack.
  640. int param2 = (int)luaL_checkint(state, 3);
  641. // Get parameter 3 off the stack.
  642. int param3 = (int)luaL_checkint(state, 4);
  643. // Get parameter 4 off the stack.
  644. bool param4Valid;
  645. gameplay::ScriptUtil::LuaArray<Vector4> param4 = gameplay::ScriptUtil::getObjectPointer<Vector4>(5, "Vector4", true, &param4Valid);
  646. if (!param4Valid)
  647. break;
  648. // Get parameter 5 off the stack.
  649. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6);
  650. // Get parameter 6 off the stack.
  651. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  652. Font* instance = getInstance(state);
  653. instance->drawText(param1, param2, param3, *param4, param5, param6);
  654. return 0;
  655. }
  656. } while (0);
  657. do
  658. {
  659. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  660. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  661. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  662. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  663. lua_type(state, 5) == LUA_TNUMBER &&
  664. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  665. lua_type(state, 7) == LUA_TBOOLEAN)
  666. {
  667. // Get parameter 1 off the stack.
  668. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  669. // Get parameter 2 off the stack.
  670. bool param2Valid;
  671. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  672. if (!param2Valid)
  673. break;
  674. // Get parameter 3 off the stack.
  675. bool param3Valid;
  676. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  677. if (!param3Valid)
  678. break;
  679. // Get parameter 4 off the stack.
  680. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  681. // Get parameter 5 off the stack.
  682. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  683. // Get parameter 6 off the stack.
  684. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  685. Font* instance = getInstance(state);
  686. instance->drawText(param1, *param2, *param3, param4, param5, param6);
  687. return 0;
  688. }
  689. } while (0);
  690. lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature.");
  691. lua_error(state);
  692. break;
  693. }
  694. case 8:
  695. {
  696. do
  697. {
  698. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  699. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  700. lua_type(state, 3) == LUA_TNUMBER &&
  701. lua_type(state, 4) == LUA_TNUMBER &&
  702. lua_type(state, 5) == LUA_TNUMBER &&
  703. lua_type(state, 6) == LUA_TNUMBER &&
  704. lua_type(state, 7) == LUA_TNUMBER &&
  705. lua_type(state, 8) == LUA_TNUMBER)
  706. {
  707. // Get parameter 1 off the stack.
  708. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  709. // Get parameter 2 off the stack.
  710. int param2 = (int)luaL_checkint(state, 3);
  711. // Get parameter 3 off the stack.
  712. int param3 = (int)luaL_checkint(state, 4);
  713. // Get parameter 4 off the stack.
  714. float param4 = (float)luaL_checknumber(state, 5);
  715. // Get parameter 5 off the stack.
  716. float param5 = (float)luaL_checknumber(state, 6);
  717. // Get parameter 6 off the stack.
  718. float param6 = (float)luaL_checknumber(state, 7);
  719. // Get parameter 7 off the stack.
  720. float param7 = (float)luaL_checknumber(state, 8);
  721. Font* instance = getInstance(state);
  722. instance->drawText(param1, param2, param3, param4, param5, param6, param7);
  723. return 0;
  724. }
  725. } while (0);
  726. do
  727. {
  728. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  729. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  730. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  731. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  732. lua_type(state, 5) == LUA_TNUMBER &&
  733. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  734. lua_type(state, 7) == LUA_TBOOLEAN &&
  735. lua_type(state, 8) == LUA_TBOOLEAN)
  736. {
  737. // Get parameter 1 off the stack.
  738. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  739. // Get parameter 2 off the stack.
  740. bool param2Valid;
  741. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  742. if (!param2Valid)
  743. break;
  744. // Get parameter 3 off the stack.
  745. bool param3Valid;
  746. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  747. if (!param3Valid)
  748. break;
  749. // Get parameter 4 off the stack.
  750. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  751. // Get parameter 5 off the stack.
  752. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  753. // Get parameter 6 off the stack.
  754. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  755. // Get parameter 7 off the stack.
  756. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  757. Font* instance = getInstance(state);
  758. instance->drawText(param1, *param2, *param3, param4, param5, param6, param7);
  759. return 0;
  760. }
  761. } while (0);
  762. lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature.");
  763. lua_error(state);
  764. break;
  765. }
  766. case 9:
  767. {
  768. do
  769. {
  770. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  771. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  772. lua_type(state, 3) == LUA_TNUMBER &&
  773. lua_type(state, 4) == LUA_TNUMBER &&
  774. lua_type(state, 5) == LUA_TNUMBER &&
  775. lua_type(state, 6) == LUA_TNUMBER &&
  776. lua_type(state, 7) == LUA_TNUMBER &&
  777. lua_type(state, 8) == LUA_TNUMBER &&
  778. lua_type(state, 9) == LUA_TNUMBER)
  779. {
  780. // Get parameter 1 off the stack.
  781. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  782. // Get parameter 2 off the stack.
  783. int param2 = (int)luaL_checkint(state, 3);
  784. // Get parameter 3 off the stack.
  785. int param3 = (int)luaL_checkint(state, 4);
  786. // Get parameter 4 off the stack.
  787. float param4 = (float)luaL_checknumber(state, 5);
  788. // Get parameter 5 off the stack.
  789. float param5 = (float)luaL_checknumber(state, 6);
  790. // Get parameter 6 off the stack.
  791. float param6 = (float)luaL_checknumber(state, 7);
  792. // Get parameter 7 off the stack.
  793. float param7 = (float)luaL_checknumber(state, 8);
  794. // Get parameter 8 off the stack.
  795. unsigned int param8 = (unsigned int)luaL_checkunsigned(state, 9);
  796. Font* instance = getInstance(state);
  797. instance->drawText(param1, param2, param3, param4, param5, param6, param7, param8);
  798. return 0;
  799. }
  800. } while (0);
  801. do
  802. {
  803. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  804. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  805. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  806. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  807. lua_type(state, 5) == LUA_TNUMBER &&
  808. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  809. lua_type(state, 7) == LUA_TBOOLEAN &&
  810. lua_type(state, 8) == LUA_TBOOLEAN &&
  811. (lua_type(state, 9) == LUA_TUSERDATA || lua_type(state, 9) == LUA_TTABLE || lua_type(state, 9) == LUA_TNIL))
  812. {
  813. // Get parameter 1 off the stack.
  814. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  815. // Get parameter 2 off the stack.
  816. bool param2Valid;
  817. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  818. if (!param2Valid)
  819. break;
  820. // Get parameter 3 off the stack.
  821. bool param3Valid;
  822. gameplay::ScriptUtil::LuaArray<Vector4> param3 = gameplay::ScriptUtil::getObjectPointer<Vector4>(4, "Vector4", true, &param3Valid);
  823. if (!param3Valid)
  824. break;
  825. // Get parameter 4 off the stack.
  826. unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 5);
  827. // Get parameter 5 off the stack.
  828. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  829. // Get parameter 6 off the stack.
  830. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  831. // Get parameter 7 off the stack.
  832. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  833. // Get parameter 8 off the stack.
  834. bool param8Valid;
  835. gameplay::ScriptUtil::LuaArray<Rectangle> param8 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(9, "Rectangle", false, &param8Valid);
  836. if (!param8Valid)
  837. break;
  838. Font* instance = getInstance(state);
  839. instance->drawText(param1, *param2, *param3, param4, param5, param6, param7, param8);
  840. return 0;
  841. }
  842. } while (0);
  843. lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature.");
  844. lua_error(state);
  845. break;
  846. }
  847. case 10:
  848. {
  849. do
  850. {
  851. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  852. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  853. lua_type(state, 3) == LUA_TNUMBER &&
  854. lua_type(state, 4) == LUA_TNUMBER &&
  855. lua_type(state, 5) == LUA_TNUMBER &&
  856. lua_type(state, 6) == LUA_TNUMBER &&
  857. lua_type(state, 7) == LUA_TNUMBER &&
  858. lua_type(state, 8) == LUA_TNUMBER &&
  859. lua_type(state, 9) == LUA_TNUMBER &&
  860. lua_type(state, 10) == LUA_TBOOLEAN)
  861. {
  862. // Get parameter 1 off the stack.
  863. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  864. // Get parameter 2 off the stack.
  865. int param2 = (int)luaL_checkint(state, 3);
  866. // Get parameter 3 off the stack.
  867. int param3 = (int)luaL_checkint(state, 4);
  868. // Get parameter 4 off the stack.
  869. float param4 = (float)luaL_checknumber(state, 5);
  870. // Get parameter 5 off the stack.
  871. float param5 = (float)luaL_checknumber(state, 6);
  872. // Get parameter 6 off the stack.
  873. float param6 = (float)luaL_checknumber(state, 7);
  874. // Get parameter 7 off the stack.
  875. float param7 = (float)luaL_checknumber(state, 8);
  876. // Get parameter 8 off the stack.
  877. unsigned int param8 = (unsigned int)luaL_checkunsigned(state, 9);
  878. // Get parameter 9 off the stack.
  879. bool param9 = gameplay::ScriptUtil::luaCheckBool(state, 10);
  880. Font* instance = getInstance(state);
  881. instance->drawText(param1, param2, param3, param4, param5, param6, param7, param8, param9);
  882. return 0;
  883. }
  884. } while (0);
  885. lua_pushstring(state, "lua_Font_drawText - Failed to match the given parameters to a valid function signature.");
  886. lua_error(state);
  887. break;
  888. }
  889. default:
  890. {
  891. lua_pushstring(state, "Invalid number of parameters (expected 2, 4, 5, 6, 7, 8, 9 or 10).");
  892. lua_error(state);
  893. break;
  894. }
  895. }
  896. return 0;
  897. }
  898. int lua_Font_finish(lua_State* state)
  899. {
  900. // Get the number of parameters.
  901. int paramCount = lua_gettop(state);
  902. // Attempt to match the parameters to a valid binding.
  903. switch (paramCount)
  904. {
  905. case 1:
  906. {
  907. if ((lua_type(state, 1) == LUA_TUSERDATA))
  908. {
  909. Font* instance = getInstance(state);
  910. instance->finish();
  911. return 0;
  912. }
  913. lua_pushstring(state, "lua_Font_finish - Failed to match the given parameters to a valid function signature.");
  914. lua_error(state);
  915. break;
  916. }
  917. default:
  918. {
  919. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  920. lua_error(state);
  921. break;
  922. }
  923. }
  924. return 0;
  925. }
  926. int lua_Font_getCharacterSpacing(lua_State* state)
  927. {
  928. // Get the number of parameters.
  929. int paramCount = lua_gettop(state);
  930. // Attempt to match the parameters to a valid binding.
  931. switch (paramCount)
  932. {
  933. case 1:
  934. {
  935. if ((lua_type(state, 1) == LUA_TUSERDATA))
  936. {
  937. Font* instance = getInstance(state);
  938. float result = instance->getCharacterSpacing();
  939. // Push the return value onto the stack.
  940. lua_pushnumber(state, result);
  941. return 1;
  942. }
  943. lua_pushstring(state, "lua_Font_getCharacterSpacing - Failed to match the given parameters to a valid function signature.");
  944. lua_error(state);
  945. break;
  946. }
  947. default:
  948. {
  949. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  950. lua_error(state);
  951. break;
  952. }
  953. }
  954. return 0;
  955. }
  956. int lua_Font_getIndexAtLocation(lua_State* state)
  957. {
  958. // Get the number of parameters.
  959. int paramCount = lua_gettop(state);
  960. // Attempt to match the parameters to a valid binding.
  961. switch (paramCount)
  962. {
  963. case 6:
  964. {
  965. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  966. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  967. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  968. lua_type(state, 4) == LUA_TNUMBER &&
  969. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) &&
  970. (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL))
  971. {
  972. // Get parameter 1 off the stack.
  973. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  974. // Get parameter 2 off the stack.
  975. bool param2Valid;
  976. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  977. if (!param2Valid)
  978. {
  979. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  980. lua_error(state);
  981. }
  982. // Get parameter 3 off the stack.
  983. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  984. // Get parameter 4 off the stack.
  985. bool param4Valid;
  986. gameplay::ScriptUtil::LuaArray<Vector2> param4 = gameplay::ScriptUtil::getObjectPointer<Vector2>(5, "Vector2", true, &param4Valid);
  987. if (!param4Valid)
  988. {
  989. lua_pushstring(state, "Failed to convert parameter 4 to type 'Vector2'.");
  990. lua_error(state);
  991. }
  992. // Get parameter 5 off the stack.
  993. bool param5Valid;
  994. gameplay::ScriptUtil::LuaArray<Vector2> param5 = gameplay::ScriptUtil::getObjectPointer<Vector2>(6, "Vector2", false, &param5Valid);
  995. if (!param5Valid)
  996. {
  997. lua_pushstring(state, "Failed to convert parameter 5 to type 'Vector2'.");
  998. lua_error(state);
  999. }
  1000. Font* instance = getInstance(state);
  1001. int result = instance->getIndexAtLocation(param1, *param2, param3, *param4, param5);
  1002. // Push the return value onto the stack.
  1003. lua_pushinteger(state, result);
  1004. return 1;
  1005. }
  1006. lua_pushstring(state, "lua_Font_getIndexAtLocation - Failed to match the given parameters to a valid function signature.");
  1007. lua_error(state);
  1008. break;
  1009. }
  1010. case 7:
  1011. {
  1012. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1013. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1014. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1015. lua_type(state, 4) == LUA_TNUMBER &&
  1016. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) &&
  1017. (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL) &&
  1018. (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL))
  1019. {
  1020. // Get parameter 1 off the stack.
  1021. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1022. // Get parameter 2 off the stack.
  1023. bool param2Valid;
  1024. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1025. if (!param2Valid)
  1026. {
  1027. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  1028. lua_error(state);
  1029. }
  1030. // Get parameter 3 off the stack.
  1031. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1032. // Get parameter 4 off the stack.
  1033. bool param4Valid;
  1034. gameplay::ScriptUtil::LuaArray<Vector2> param4 = gameplay::ScriptUtil::getObjectPointer<Vector2>(5, "Vector2", true, &param4Valid);
  1035. if (!param4Valid)
  1036. {
  1037. lua_pushstring(state, "Failed to convert parameter 4 to type 'Vector2'.");
  1038. lua_error(state);
  1039. }
  1040. // Get parameter 5 off the stack.
  1041. bool param5Valid;
  1042. gameplay::ScriptUtil::LuaArray<Vector2> param5 = gameplay::ScriptUtil::getObjectPointer<Vector2>(6, "Vector2", false, &param5Valid);
  1043. if (!param5Valid)
  1044. {
  1045. lua_pushstring(state, "Failed to convert parameter 5 to type 'Vector2'.");
  1046. lua_error(state);
  1047. }
  1048. // Get parameter 6 off the stack.
  1049. Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
  1050. Font* instance = getInstance(state);
  1051. int result = instance->getIndexAtLocation(param1, *param2, param3, *param4, param5, param6);
  1052. // Push the return value onto the stack.
  1053. lua_pushinteger(state, result);
  1054. return 1;
  1055. }
  1056. lua_pushstring(state, "lua_Font_getIndexAtLocation - Failed to match the given parameters to a valid function signature.");
  1057. lua_error(state);
  1058. break;
  1059. }
  1060. case 8:
  1061. {
  1062. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1063. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1064. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1065. lua_type(state, 4) == LUA_TNUMBER &&
  1066. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) &&
  1067. (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL) &&
  1068. (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL) &&
  1069. lua_type(state, 8) == LUA_TBOOLEAN)
  1070. {
  1071. // Get parameter 1 off the stack.
  1072. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1073. // Get parameter 2 off the stack.
  1074. bool param2Valid;
  1075. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1076. if (!param2Valid)
  1077. {
  1078. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  1079. lua_error(state);
  1080. }
  1081. // Get parameter 3 off the stack.
  1082. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1083. // Get parameter 4 off the stack.
  1084. bool param4Valid;
  1085. gameplay::ScriptUtil::LuaArray<Vector2> param4 = gameplay::ScriptUtil::getObjectPointer<Vector2>(5, "Vector2", true, &param4Valid);
  1086. if (!param4Valid)
  1087. {
  1088. lua_pushstring(state, "Failed to convert parameter 4 to type 'Vector2'.");
  1089. lua_error(state);
  1090. }
  1091. // Get parameter 5 off the stack.
  1092. bool param5Valid;
  1093. gameplay::ScriptUtil::LuaArray<Vector2> param5 = gameplay::ScriptUtil::getObjectPointer<Vector2>(6, "Vector2", false, &param5Valid);
  1094. if (!param5Valid)
  1095. {
  1096. lua_pushstring(state, "Failed to convert parameter 5 to type 'Vector2'.");
  1097. lua_error(state);
  1098. }
  1099. // Get parameter 6 off the stack.
  1100. Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
  1101. // Get parameter 7 off the stack.
  1102. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  1103. Font* instance = getInstance(state);
  1104. int result = instance->getIndexAtLocation(param1, *param2, param3, *param4, param5, param6, param7);
  1105. // Push the return value onto the stack.
  1106. lua_pushinteger(state, result);
  1107. return 1;
  1108. }
  1109. lua_pushstring(state, "lua_Font_getIndexAtLocation - Failed to match the given parameters to a valid function signature.");
  1110. lua_error(state);
  1111. break;
  1112. }
  1113. case 9:
  1114. {
  1115. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1116. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1117. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1118. lua_type(state, 4) == LUA_TNUMBER &&
  1119. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL) &&
  1120. (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL) &&
  1121. (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL) &&
  1122. lua_type(state, 8) == LUA_TBOOLEAN &&
  1123. lua_type(state, 9) == LUA_TBOOLEAN)
  1124. {
  1125. // Get parameter 1 off the stack.
  1126. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1127. // Get parameter 2 off the stack.
  1128. bool param2Valid;
  1129. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1130. if (!param2Valid)
  1131. {
  1132. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  1133. lua_error(state);
  1134. }
  1135. // Get parameter 3 off the stack.
  1136. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1137. // Get parameter 4 off the stack.
  1138. bool param4Valid;
  1139. gameplay::ScriptUtil::LuaArray<Vector2> param4 = gameplay::ScriptUtil::getObjectPointer<Vector2>(5, "Vector2", true, &param4Valid);
  1140. if (!param4Valid)
  1141. {
  1142. lua_pushstring(state, "Failed to convert parameter 4 to type 'Vector2'.");
  1143. lua_error(state);
  1144. }
  1145. // Get parameter 5 off the stack.
  1146. bool param5Valid;
  1147. gameplay::ScriptUtil::LuaArray<Vector2> param5 = gameplay::ScriptUtil::getObjectPointer<Vector2>(6, "Vector2", false, &param5Valid);
  1148. if (!param5Valid)
  1149. {
  1150. lua_pushstring(state, "Failed to convert parameter 5 to type 'Vector2'.");
  1151. lua_error(state);
  1152. }
  1153. // Get parameter 6 off the stack.
  1154. Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
  1155. // Get parameter 7 off the stack.
  1156. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  1157. // Get parameter 8 off the stack.
  1158. bool param8 = gameplay::ScriptUtil::luaCheckBool(state, 9);
  1159. Font* instance = getInstance(state);
  1160. int result = instance->getIndexAtLocation(param1, *param2, param3, *param4, param5, param6, param7, param8);
  1161. // Push the return value onto the stack.
  1162. lua_pushinteger(state, result);
  1163. return 1;
  1164. }
  1165. lua_pushstring(state, "lua_Font_getIndexAtLocation - Failed to match the given parameters to a valid function signature.");
  1166. lua_error(state);
  1167. break;
  1168. }
  1169. default:
  1170. {
  1171. lua_pushstring(state, "Invalid number of parameters (expected 6, 7, 8 or 9).");
  1172. lua_error(state);
  1173. break;
  1174. }
  1175. }
  1176. return 0;
  1177. }
  1178. int lua_Font_getLocationAtIndex(lua_State* state)
  1179. {
  1180. // Get the number of parameters.
  1181. int paramCount = lua_gettop(state);
  1182. // Attempt to match the parameters to a valid binding.
  1183. switch (paramCount)
  1184. {
  1185. case 6:
  1186. {
  1187. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1188. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1189. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1190. lua_type(state, 4) == LUA_TNUMBER &&
  1191. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) &&
  1192. lua_type(state, 6) == LUA_TNUMBER)
  1193. {
  1194. // Get parameter 1 off the stack.
  1195. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1196. // Get parameter 2 off the stack.
  1197. bool param2Valid;
  1198. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1199. if (!param2Valid)
  1200. {
  1201. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  1202. lua_error(state);
  1203. }
  1204. // Get parameter 3 off the stack.
  1205. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1206. // Get parameter 4 off the stack.
  1207. bool param4Valid;
  1208. gameplay::ScriptUtil::LuaArray<Vector2> param4 = gameplay::ScriptUtil::getObjectPointer<Vector2>(5, "Vector2", false, &param4Valid);
  1209. if (!param4Valid)
  1210. {
  1211. lua_pushstring(state, "Failed to convert parameter 4 to type 'Vector2'.");
  1212. lua_error(state);
  1213. }
  1214. // Get parameter 5 off the stack.
  1215. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6);
  1216. Font* instance = getInstance(state);
  1217. instance->getLocationAtIndex(param1, *param2, param3, param4, param5);
  1218. return 0;
  1219. }
  1220. lua_pushstring(state, "lua_Font_getLocationAtIndex - Failed to match the given parameters to a valid function signature.");
  1221. lua_error(state);
  1222. break;
  1223. }
  1224. case 7:
  1225. {
  1226. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1227. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1228. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1229. lua_type(state, 4) == LUA_TNUMBER &&
  1230. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) &&
  1231. lua_type(state, 6) == LUA_TNUMBER &&
  1232. (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL))
  1233. {
  1234. // Get parameter 1 off the stack.
  1235. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1236. // Get parameter 2 off the stack.
  1237. bool param2Valid;
  1238. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1239. if (!param2Valid)
  1240. {
  1241. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  1242. lua_error(state);
  1243. }
  1244. // Get parameter 3 off the stack.
  1245. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1246. // Get parameter 4 off the stack.
  1247. bool param4Valid;
  1248. gameplay::ScriptUtil::LuaArray<Vector2> param4 = gameplay::ScriptUtil::getObjectPointer<Vector2>(5, "Vector2", false, &param4Valid);
  1249. if (!param4Valid)
  1250. {
  1251. lua_pushstring(state, "Failed to convert parameter 4 to type 'Vector2'.");
  1252. lua_error(state);
  1253. }
  1254. // Get parameter 5 off the stack.
  1255. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6);
  1256. // Get parameter 6 off the stack.
  1257. Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
  1258. Font* instance = getInstance(state);
  1259. instance->getLocationAtIndex(param1, *param2, param3, param4, param5, param6);
  1260. return 0;
  1261. }
  1262. lua_pushstring(state, "lua_Font_getLocationAtIndex - Failed to match the given parameters to a valid function signature.");
  1263. lua_error(state);
  1264. break;
  1265. }
  1266. case 8:
  1267. {
  1268. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1269. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1270. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1271. lua_type(state, 4) == LUA_TNUMBER &&
  1272. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) &&
  1273. lua_type(state, 6) == LUA_TNUMBER &&
  1274. (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL) &&
  1275. lua_type(state, 8) == LUA_TBOOLEAN)
  1276. {
  1277. // Get parameter 1 off the stack.
  1278. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1279. // Get parameter 2 off the stack.
  1280. bool param2Valid;
  1281. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1282. if (!param2Valid)
  1283. {
  1284. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  1285. lua_error(state);
  1286. }
  1287. // Get parameter 3 off the stack.
  1288. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1289. // Get parameter 4 off the stack.
  1290. bool param4Valid;
  1291. gameplay::ScriptUtil::LuaArray<Vector2> param4 = gameplay::ScriptUtil::getObjectPointer<Vector2>(5, "Vector2", false, &param4Valid);
  1292. if (!param4Valid)
  1293. {
  1294. lua_pushstring(state, "Failed to convert parameter 4 to type 'Vector2'.");
  1295. lua_error(state);
  1296. }
  1297. // Get parameter 5 off the stack.
  1298. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6);
  1299. // Get parameter 6 off the stack.
  1300. Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
  1301. // Get parameter 7 off the stack.
  1302. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  1303. Font* instance = getInstance(state);
  1304. instance->getLocationAtIndex(param1, *param2, param3, param4, param5, param6, param7);
  1305. return 0;
  1306. }
  1307. lua_pushstring(state, "lua_Font_getLocationAtIndex - Failed to match the given parameters to a valid function signature.");
  1308. lua_error(state);
  1309. break;
  1310. }
  1311. case 9:
  1312. {
  1313. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1314. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1315. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1316. lua_type(state, 4) == LUA_TNUMBER &&
  1317. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) &&
  1318. lua_type(state, 6) == LUA_TNUMBER &&
  1319. (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL) &&
  1320. lua_type(state, 8) == LUA_TBOOLEAN &&
  1321. lua_type(state, 9) == LUA_TBOOLEAN)
  1322. {
  1323. // Get parameter 1 off the stack.
  1324. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1325. // Get parameter 2 off the stack.
  1326. bool param2Valid;
  1327. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1328. if (!param2Valid)
  1329. {
  1330. lua_pushstring(state, "Failed to convert parameter 2 to type 'Rectangle'.");
  1331. lua_error(state);
  1332. }
  1333. // Get parameter 3 off the stack.
  1334. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1335. // Get parameter 4 off the stack.
  1336. bool param4Valid;
  1337. gameplay::ScriptUtil::LuaArray<Vector2> param4 = gameplay::ScriptUtil::getObjectPointer<Vector2>(5, "Vector2", false, &param4Valid);
  1338. if (!param4Valid)
  1339. {
  1340. lua_pushstring(state, "Failed to convert parameter 4 to type 'Vector2'.");
  1341. lua_error(state);
  1342. }
  1343. // Get parameter 5 off the stack.
  1344. unsigned int param5 = (unsigned int)luaL_checkunsigned(state, 6);
  1345. // Get parameter 6 off the stack.
  1346. Font::Justify param6 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 7));
  1347. // Get parameter 7 off the stack.
  1348. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  1349. // Get parameter 8 off the stack.
  1350. bool param8 = gameplay::ScriptUtil::luaCheckBool(state, 9);
  1351. Font* instance = getInstance(state);
  1352. instance->getLocationAtIndex(param1, *param2, param3, param4, param5, param6, param7, param8);
  1353. return 0;
  1354. }
  1355. lua_pushstring(state, "lua_Font_getLocationAtIndex - Failed to match the given parameters to a valid function signature.");
  1356. lua_error(state);
  1357. break;
  1358. }
  1359. default:
  1360. {
  1361. lua_pushstring(state, "Invalid number of parameters (expected 6, 7, 8 or 9).");
  1362. lua_error(state);
  1363. break;
  1364. }
  1365. }
  1366. return 0;
  1367. }
  1368. int lua_Font_getRefCount(lua_State* state)
  1369. {
  1370. // Get the number of parameters.
  1371. int paramCount = lua_gettop(state);
  1372. // Attempt to match the parameters to a valid binding.
  1373. switch (paramCount)
  1374. {
  1375. case 1:
  1376. {
  1377. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1378. {
  1379. Font* instance = getInstance(state);
  1380. unsigned int result = instance->getRefCount();
  1381. // Push the return value onto the stack.
  1382. lua_pushunsigned(state, result);
  1383. return 1;
  1384. }
  1385. lua_pushstring(state, "lua_Font_getRefCount - Failed to match the given parameters to a valid function signature.");
  1386. lua_error(state);
  1387. break;
  1388. }
  1389. default:
  1390. {
  1391. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1392. lua_error(state);
  1393. break;
  1394. }
  1395. }
  1396. return 0;
  1397. }
  1398. int lua_Font_getSize(lua_State* state)
  1399. {
  1400. // Get the number of parameters.
  1401. int paramCount = lua_gettop(state);
  1402. // Attempt to match the parameters to a valid binding.
  1403. switch (paramCount)
  1404. {
  1405. case 1:
  1406. {
  1407. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1408. {
  1409. Font* instance = getInstance(state);
  1410. unsigned int result = instance->getSize();
  1411. // Push the return value onto the stack.
  1412. lua_pushunsigned(state, result);
  1413. return 1;
  1414. }
  1415. lua_pushstring(state, "lua_Font_getSize - Failed to match the given parameters to a valid function signature.");
  1416. lua_error(state);
  1417. break;
  1418. }
  1419. default:
  1420. {
  1421. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1422. lua_error(state);
  1423. break;
  1424. }
  1425. }
  1426. return 0;
  1427. }
  1428. int lua_Font_getSpriteBatch(lua_State* state)
  1429. {
  1430. // Get the number of parameters.
  1431. int paramCount = lua_gettop(state);
  1432. // Attempt to match the parameters to a valid binding.
  1433. switch (paramCount)
  1434. {
  1435. case 1:
  1436. {
  1437. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1438. {
  1439. Font* instance = getInstance(state);
  1440. void* returnPtr = (void*)instance->getSpriteBatch();
  1441. if (returnPtr)
  1442. {
  1443. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  1444. object->instance = returnPtr;
  1445. object->owns = false;
  1446. luaL_getmetatable(state, "SpriteBatch");
  1447. lua_setmetatable(state, -2);
  1448. }
  1449. else
  1450. {
  1451. lua_pushnil(state);
  1452. }
  1453. return 1;
  1454. }
  1455. lua_pushstring(state, "lua_Font_getSpriteBatch - Failed to match the given parameters to a valid function signature.");
  1456. lua_error(state);
  1457. break;
  1458. }
  1459. default:
  1460. {
  1461. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1462. lua_error(state);
  1463. break;
  1464. }
  1465. }
  1466. return 0;
  1467. }
  1468. int lua_Font_measureText(lua_State* state)
  1469. {
  1470. // Get the number of parameters.
  1471. int paramCount = lua_gettop(state);
  1472. // Attempt to match the parameters to a valid binding.
  1473. switch (paramCount)
  1474. {
  1475. case 5:
  1476. {
  1477. do
  1478. {
  1479. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1480. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1481. lua_type(state, 3) == LUA_TNUMBER &&
  1482. (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
  1483. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA))
  1484. {
  1485. // Get parameter 1 off the stack.
  1486. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1487. // Get parameter 2 off the stack.
  1488. unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 3);
  1489. // Get parameter 3 off the stack.
  1490. gameplay::ScriptUtil::LuaArray<unsigned int> param3 = gameplay::ScriptUtil::getUnsignedIntPointer(4);
  1491. // Get parameter 4 off the stack.
  1492. gameplay::ScriptUtil::LuaArray<unsigned int> param4 = gameplay::ScriptUtil::getUnsignedIntPointer(5);
  1493. Font* instance = getInstance(state);
  1494. instance->measureText(param1, param2, param3, param4);
  1495. return 0;
  1496. }
  1497. } while (0);
  1498. do
  1499. {
  1500. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1501. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1502. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1503. lua_type(state, 4) == LUA_TNUMBER &&
  1504. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL))
  1505. {
  1506. // Get parameter 1 off the stack.
  1507. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1508. // Get parameter 2 off the stack.
  1509. bool param2Valid;
  1510. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1511. if (!param2Valid)
  1512. break;
  1513. // Get parameter 3 off the stack.
  1514. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1515. // Get parameter 4 off the stack.
  1516. bool param4Valid;
  1517. gameplay::ScriptUtil::LuaArray<Rectangle> param4 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(5, "Rectangle", false, &param4Valid);
  1518. if (!param4Valid)
  1519. break;
  1520. Font* instance = getInstance(state);
  1521. instance->measureText(param1, *param2, param3, param4);
  1522. return 0;
  1523. }
  1524. } while (0);
  1525. lua_pushstring(state, "lua_Font_measureText - Failed to match the given parameters to a valid function signature.");
  1526. lua_error(state);
  1527. break;
  1528. }
  1529. case 6:
  1530. {
  1531. do
  1532. {
  1533. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1534. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1535. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1536. lua_type(state, 4) == LUA_TNUMBER &&
  1537. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) &&
  1538. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL))
  1539. {
  1540. // Get parameter 1 off the stack.
  1541. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1542. // Get parameter 2 off the stack.
  1543. bool param2Valid;
  1544. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1545. if (!param2Valid)
  1546. break;
  1547. // Get parameter 3 off the stack.
  1548. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1549. // Get parameter 4 off the stack.
  1550. bool param4Valid;
  1551. gameplay::ScriptUtil::LuaArray<Rectangle> param4 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(5, "Rectangle", false, &param4Valid);
  1552. if (!param4Valid)
  1553. break;
  1554. // Get parameter 5 off the stack.
  1555. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  1556. Font* instance = getInstance(state);
  1557. instance->measureText(param1, *param2, param3, param4, param5);
  1558. return 0;
  1559. }
  1560. } while (0);
  1561. lua_pushstring(state, "lua_Font_measureText - Failed to match the given parameters to a valid function signature.");
  1562. lua_error(state);
  1563. break;
  1564. }
  1565. case 7:
  1566. {
  1567. do
  1568. {
  1569. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1570. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1571. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1572. lua_type(state, 4) == LUA_TNUMBER &&
  1573. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) &&
  1574. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  1575. lua_type(state, 7) == LUA_TBOOLEAN)
  1576. {
  1577. // Get parameter 1 off the stack.
  1578. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1579. // Get parameter 2 off the stack.
  1580. bool param2Valid;
  1581. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1582. if (!param2Valid)
  1583. break;
  1584. // Get parameter 3 off the stack.
  1585. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1586. // Get parameter 4 off the stack.
  1587. bool param4Valid;
  1588. gameplay::ScriptUtil::LuaArray<Rectangle> param4 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(5, "Rectangle", false, &param4Valid);
  1589. if (!param4Valid)
  1590. break;
  1591. // Get parameter 5 off the stack.
  1592. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  1593. // Get parameter 6 off the stack.
  1594. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  1595. Font* instance = getInstance(state);
  1596. instance->measureText(param1, *param2, param3, param4, param5, param6);
  1597. return 0;
  1598. }
  1599. } while (0);
  1600. lua_pushstring(state, "lua_Font_measureText - Failed to match the given parameters to a valid function signature.");
  1601. lua_error(state);
  1602. break;
  1603. }
  1604. case 8:
  1605. {
  1606. do
  1607. {
  1608. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1609. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1610. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1611. lua_type(state, 4) == LUA_TNUMBER &&
  1612. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL) &&
  1613. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  1614. lua_type(state, 7) == LUA_TBOOLEAN &&
  1615. lua_type(state, 8) == LUA_TBOOLEAN)
  1616. {
  1617. // Get parameter 1 off the stack.
  1618. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1619. // Get parameter 2 off the stack.
  1620. bool param2Valid;
  1621. gameplay::ScriptUtil::LuaArray<Rectangle> param2 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true, &param2Valid);
  1622. if (!param2Valid)
  1623. break;
  1624. // Get parameter 3 off the stack.
  1625. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  1626. // Get parameter 4 off the stack.
  1627. bool param4Valid;
  1628. gameplay::ScriptUtil::LuaArray<Rectangle> param4 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(5, "Rectangle", false, &param4Valid);
  1629. if (!param4Valid)
  1630. break;
  1631. // Get parameter 5 off the stack.
  1632. Font::Justify param5 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 6));
  1633. // Get parameter 6 off the stack.
  1634. bool param6 = gameplay::ScriptUtil::luaCheckBool(state, 7);
  1635. // Get parameter 7 off the stack.
  1636. bool param7 = gameplay::ScriptUtil::luaCheckBool(state, 8);
  1637. Font* instance = getInstance(state);
  1638. instance->measureText(param1, *param2, param3, param4, param5, param6, param7);
  1639. return 0;
  1640. }
  1641. } while (0);
  1642. lua_pushstring(state, "lua_Font_measureText - Failed to match the given parameters to a valid function signature.");
  1643. lua_error(state);
  1644. break;
  1645. }
  1646. default:
  1647. {
  1648. lua_pushstring(state, "Invalid number of parameters (expected 5, 6, 7 or 8).");
  1649. lua_error(state);
  1650. break;
  1651. }
  1652. }
  1653. return 0;
  1654. }
  1655. int lua_Font_release(lua_State* state)
  1656. {
  1657. // Get the number of parameters.
  1658. int paramCount = lua_gettop(state);
  1659. // Attempt to match the parameters to a valid binding.
  1660. switch (paramCount)
  1661. {
  1662. case 1:
  1663. {
  1664. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1665. {
  1666. Font* instance = getInstance(state);
  1667. instance->release();
  1668. return 0;
  1669. }
  1670. lua_pushstring(state, "lua_Font_release - Failed to match the given parameters to a valid function signature.");
  1671. lua_error(state);
  1672. break;
  1673. }
  1674. default:
  1675. {
  1676. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1677. lua_error(state);
  1678. break;
  1679. }
  1680. }
  1681. return 0;
  1682. }
  1683. int lua_Font_setCharacterSpacing(lua_State* state)
  1684. {
  1685. // Get the number of parameters.
  1686. int paramCount = lua_gettop(state);
  1687. // Attempt to match the parameters to a valid binding.
  1688. switch (paramCount)
  1689. {
  1690. case 2:
  1691. {
  1692. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1693. lua_type(state, 2) == LUA_TNUMBER)
  1694. {
  1695. // Get parameter 1 off the stack.
  1696. float param1 = (float)luaL_checknumber(state, 2);
  1697. Font* instance = getInstance(state);
  1698. instance->setCharacterSpacing(param1);
  1699. return 0;
  1700. }
  1701. lua_pushstring(state, "lua_Font_setCharacterSpacing - Failed to match the given parameters to a valid function signature.");
  1702. lua_error(state);
  1703. break;
  1704. }
  1705. default:
  1706. {
  1707. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1708. lua_error(state);
  1709. break;
  1710. }
  1711. }
  1712. return 0;
  1713. }
  1714. int lua_Font_start(lua_State* state)
  1715. {
  1716. // Get the number of parameters.
  1717. int paramCount = lua_gettop(state);
  1718. // Attempt to match the parameters to a valid binding.
  1719. switch (paramCount)
  1720. {
  1721. case 1:
  1722. {
  1723. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1724. {
  1725. Font* instance = getInstance(state);
  1726. instance->start();
  1727. return 0;
  1728. }
  1729. lua_pushstring(state, "lua_Font_start - Failed to match the given parameters to a valid function signature.");
  1730. lua_error(state);
  1731. break;
  1732. }
  1733. default:
  1734. {
  1735. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1736. lua_error(state);
  1737. break;
  1738. }
  1739. }
  1740. return 0;
  1741. }
  1742. int lua_Font_static_create(lua_State* state)
  1743. {
  1744. // Get the number of parameters.
  1745. int paramCount = lua_gettop(state);
  1746. // Attempt to match the parameters to a valid binding.
  1747. switch (paramCount)
  1748. {
  1749. case 1:
  1750. {
  1751. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
  1752. {
  1753. // Get parameter 1 off the stack.
  1754. const char* param1 = gameplay::ScriptUtil::getString(1, false);
  1755. void* returnPtr = (void*)Font::create(param1);
  1756. if (returnPtr)
  1757. {
  1758. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  1759. object->instance = returnPtr;
  1760. object->owns = true;
  1761. luaL_getmetatable(state, "Font");
  1762. lua_setmetatable(state, -2);
  1763. }
  1764. else
  1765. {
  1766. lua_pushnil(state);
  1767. }
  1768. return 1;
  1769. }
  1770. lua_pushstring(state, "lua_Font_static_create - Failed to match the given parameters to a valid function signature.");
  1771. lua_error(state);
  1772. break;
  1773. }
  1774. case 2:
  1775. {
  1776. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
  1777. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1778. {
  1779. // Get parameter 1 off the stack.
  1780. const char* param1 = gameplay::ScriptUtil::getString(1, false);
  1781. // Get parameter 2 off the stack.
  1782. const char* param2 = gameplay::ScriptUtil::getString(2, false);
  1783. void* returnPtr = (void*)Font::create(param1, param2);
  1784. if (returnPtr)
  1785. {
  1786. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  1787. object->instance = returnPtr;
  1788. object->owns = true;
  1789. luaL_getmetatable(state, "Font");
  1790. lua_setmetatable(state, -2);
  1791. }
  1792. else
  1793. {
  1794. lua_pushnil(state);
  1795. }
  1796. return 1;
  1797. }
  1798. lua_pushstring(state, "lua_Font_static_create - Failed to match the given parameters to a valid function signature.");
  1799. lua_error(state);
  1800. break;
  1801. }
  1802. default:
  1803. {
  1804. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1805. lua_error(state);
  1806. break;
  1807. }
  1808. }
  1809. return 0;
  1810. }
  1811. int lua_Font_static_getJustify(lua_State* state)
  1812. {
  1813. // Get the number of parameters.
  1814. int paramCount = lua_gettop(state);
  1815. // Attempt to match the parameters to a valid binding.
  1816. switch (paramCount)
  1817. {
  1818. case 1:
  1819. {
  1820. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
  1821. {
  1822. // Get parameter 1 off the stack.
  1823. const char* param1 = gameplay::ScriptUtil::getString(1, false);
  1824. Font::Justify result = Font::getJustify(param1);
  1825. // Push the return value onto the stack.
  1826. lua_pushstring(state, lua_stringFromEnum_FontJustify(result));
  1827. return 1;
  1828. }
  1829. lua_pushstring(state, "lua_Font_static_getJustify - Failed to match the given parameters to a valid function signature.");
  1830. lua_error(state);
  1831. break;
  1832. }
  1833. default:
  1834. {
  1835. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1836. lua_error(state);
  1837. break;
  1838. }
  1839. }
  1840. return 0;
  1841. }
  1842. }