lua/wrappers/gfx/lua_font.cpp
/**
	 * Measures the space in pixels that the given block of text would take up when contained
	 * to the given width.
	 *
	 * The end_character is the final character to measure up to. Defaults to the null character
	 * which indicates the end of the string. Can be changed to "\n"/13 (new line) or "."/46 (period) or even "A"/65 (A).
	 *
	 * @param string text The text to measure.
	 * @param number contain_width The width of the container.
	 * @param string/integer [\0] end_character The ending character.
	 * @returns number The width that would be taken up.
	 * @returns number The height that would be taken up.
	 */
Measures the space in pixels that the given block of text would take up when contained
to the given width.

The end_character is the final character to measure up to. Defaults to the null character
which indicates the end of the string.

@param string text The text to measure.
@param number contain_width The width of the container.
@param string/integer [\0] end_character The ending character.
@returns number The width that would be taken up.
@returns number The height that would be taken up.
Measures the space in pixels that the given block of text would take up when contained to the given width . The end_character is the final character to measure up to . Defaults to the null character which indicates the end of the string . @param string text The text to measure . @param number contain_width The width of the container . @param string / integer [ \ 0 ] end_character The ending character . @returns number The width that would be taken up . @returns number The height that would be taken up .
int Font_measure_text(lua_State *lua)
	{
		Font *font = castUData<Font>(lua, 1);
		if (font)
		{
			if (lua_isnum(lua, 2))
			{
				float width = 0.0f, height = 0.0f;
				char endChar = '\0';
				if (lua_isnum(lua, 3))
				{
					endChar = static_cast<char>(lua_tointeger(lua, 3));
				}
				else if (lua_isstr(lua, 3))
				{
					endChar = lua_tostring(lua, 3)[0];
				}
				font->measureText(lua_tostring(lua, 2), lua_tonumber(lua, 3), width, height, endChar);
				lua_pushnumber(lua, width);
				lua_pushnumber(lua, height);
				return 2;
			}
			return LuaState::expectedArgs(lua, "measure_text", "string text, number container_width, string/integer [\0] end_character");
		}
		return LuaState::expectedContext(lua, "measure_text", "am.font");
	}
int Font_measure_text ( lua_State * lua ) { Font * font = castUData < Font > ( lua , 1 ) ; if ( font ) { if ( lua_isnum ( lua , 2 ) ) { float width = 0.0f , height = 0.0f ; char endChar = ' \0 ' ; if ( lua_isnum ( lua , 3 ) ) { endChar = static_cast < char > ( lua_tointeger ( lua , 3 ) ) ; } else if ( lua_isstr ( lua , 3 ) ) { endChar = lua_tostring ( lua , 3 ) [ 0 ] ; } font -> measureText ( lua_tostring ( lua , 2 ) , lua_tonumber ( lua , 3 ) , width , height , endChar ) ; lua_pushnumber ( lua , width ) ; lua_pushnumber ( lua , height ) ; return 2 ; } return LuaState :: expectedArgs ( lua , " " , " \0 " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Measures the space in pixels that the given block of text would take up when contained
 to the given width.
Measures the space in pixels that the given block of text would take up when contained to the given width .