src/menucode.cpp
// luaMenuDrawText *******
// a function used for drawing a text from a Lua script to the screen

luaMenuDrawText
a function used for drawing a text from a Lua script to the screen
luaMenuDrawText a function used for drawing a text from a Lua script to the screen
int luaMenuDrawText(lua_State* lstate)
{
	char* fontName;
	char* text;
	fixedFontClass* font;
	int x, y, boxWidth, boxHeight;
	alignEnum h_align;
	valignEnum v_align;
	char* alignvTmp;
	char* alignhTmp;
	fontName=(char*)(lua_tostring(lstate, 1));
	text=(char*)(lua_tostring(lstate, 2));
	x=int(lua_tonumber(lstate, 3));
	y=int(lua_tonumber(lstate, 4));
	boxWidth=int(lua_tonumber(lstate, 5));
	boxHeight=int(lua_tonumber(lstate, 6));
	alignhTmp=(char*)(lua_tostring(lstate, 7));
	alignvTmp=(char*)(lua_tostring(lstate, 8));
	if (strcmp(fontName, "ediaFont")==0) {
		font=&fntEdiaFont;
	}else if (strcmp(fontName, "ediaBigFont")==0) {
		font=&fntEdiaBigFont;
	}else if (strcmp(fontName, "dahFont")==0) {
		font=&fntDahFont;
	}else {
		font=&fntDahFont;
	}
	if (strcmp(alignhTmp, "left")==0) {
		h_align=FILE_DDWRAP_ALIGN_LEFT;
	}else if (strcmp(alignhTmp, "right")==0) {
		h_align=FILE_DDWRAP_ALIGN_RIGHT;
	}else if (strcmp(alignhTmp, "center")==0) {
		h_align=FILE_DDWRAP_ALIGN_CENTER;
	}else {
		h_align=FILE_DDWRAP_ALIGN_LEFT;
	}
	if (strcmp(alignvTmp, "top")==0) {
		v_align=FILE_DDWRAP_VALIGN_TOP;
	}else if (strcmp(alignvTmp, "bottom")==0) {
		v_align=FILE_DDWRAP_VALIGN_BOTTOM;
	}else if (strcmp(alignvTmp, "center")==0) {
		v_align=FILE_DDWRAP_VALIGN_CENTER;
	}else {
		v_align=FILE_DDWRAP_VALIGN_TOP;
	}
	font->drawMultilineText(
		*screenBuffer, text, strlen(text), x, y,
		boxWidth, boxHeight, true, h_align, v_align);
	return 0;
}
int luaMenuDrawText ( lua_State * lstate ) { char * fontName ; char * text ; fixedFontClass * font ; int x , y , boxWidth , boxHeight ; alignEnum h_align ; valignEnum v_align ; char * alignvTmp ; char * alignhTmp ; fontName = ( char * ) ( lua_tostring ( lstate , 1 ) ) ; text = ( char * ) ( lua_tostring ( lstate , 2 ) ) ; x = int ( lua_tonumber ( lstate , 3 ) ) ; y = int ( lua_tonumber ( lstate , 4 ) ) ; boxWidth = int ( lua_tonumber ( lstate , 5 ) ) ; boxHeight = int ( lua_tonumber ( lstate , 6 ) ) ; alignhTmp = ( char * ) ( lua_tostring ( lstate , 7 ) ) ; alignvTmp = ( char * ) ( lua_tostring ( lstate , 8 ) ) ; if ( strcmp ( fontName , " " ) == 0 ) { font = & fntEdiaFont ; } else if ( strcmp ( fontName , " " ) == 0 ) { font = & fntEdiaBigFont ; } else if ( strcmp ( fontName , " " ) == 0 ) { font = & fntDahFont ; } else { font = & fntDahFont ; } if ( strcmp ( alignhTmp , " " ) == 0 ) { h_align = FILE_DDWRAP_ALIGN_LEFT ; } else if ( strcmp ( alignhTmp , " " ) == 0 ) { h_align = FILE_DDWRAP_ALIGN_RIGHT ; } else if ( strcmp ( alignhTmp , " " ) == 0 ) { h_align = FILE_DDWRAP_ALIGN_CENTER ; } else { h_align = FILE_DDWRAP_ALIGN_LEFT ; } if ( strcmp ( alignvTmp , " " ) == 0 ) { v_align = FILE_DDWRAP_VALIGN_TOP ; } else if ( strcmp ( alignvTmp , " " ) == 0 ) { v_align = FILE_DDWRAP_VALIGN_BOTTOM ; } else if ( strcmp ( alignvTmp , " " ) == 0 ) { v_align = FILE_DDWRAP_VALIGN_CENTER ; } else { v_align = FILE_DDWRAP_VALIGN_TOP ; } font -> drawMultilineText ( * screenBuffer , text , strlen ( text ) , x , y , boxWidth , boxHeight , true , h_align , v_align ) ; return 0 ; }
luaMenuDrawText 
a function used for drawing a text from a Lua script to the screen
luaMenuDrawText a function used for drawing a text from a Lua script to the screen
// useful variables...
 // get the parameters, in the order they should have been sent
 // select the asked font
 // default
 // select the asked h align
 // default
 // select the asked v align
 // default
 // draw the text
 // there are no return values
