lua/wrappers/game/lua_game_object.cpp
/**
	 * Sets the name of the GameObject.
	 *
	 * @param string name The name to set the GameObject.
	 * @returns am.GameObject This.
	 */
Sets the name of the GameObject.
@param string name The name to set the GameObject.
Sets the name of the GameObject . @param string name The name to set the GameObject .
int GameObject_name(lua_State *lua, GameObject *obj)
	{
		if (!obj)
		{
			return 0;
		}
		if (lua_gettop(lua) == 1)
		{
			lua_pushstring(lua, obj->getName().c_str());
			return 1;
		}
		else if (lua_isstr(lua, 2))
		{
			const char *name = lua_tostring(lua, 2);
			if (name)
			{
				obj->setName(name);
			}
			lua_first(lua);
		}
		return LuaState::expectedArgs(lua, "name", "string name");
	}
int GameObject_name ( lua_State * lua , GameObject * obj ) { if ( ! obj ) { return 0 ; } if ( lua_gettop ( lua ) == 1 ) { lua_pushstring ( lua , obj -> getName ( ) . c_str ( ) ) ; return 1 ; } else if ( lua_isstr ( lua , 2 ) ) { const char * name = lua_tostring ( lua , 2 ) ; if ( name ) { obj -> setName ( name ) ; } lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; }
Sets the name of the GameObject.
Sets the name of the GameObject .