lua/wrappers/game/lua_character.cpp
int Character_graphic(lua_State *lua)
	{
		Character *obj = castUData<Character>(lua, 1);
		if (obj)
		{
			if (lua_gettop(lua) == 1)
			{
				Sprite *sprite = obj->getGraphic();
				if (sprite)
				{
					wrapRefObject<Sprite>(lua, sprite);
				}
				else
				{
					lua_pushnil(lua);
				}
				return 1;
			}
			else
			{
				Sprite *sprite = nullptr;
				if (lua::gfx::getSprite(lua, 2, sprite))
				{
					obj->setGraphic(sprite);
					lua_first(lua);
				}
				return LuaState::expectedArgs(lua, "graphic", 3, "string asset_name", "am.sprite sprite", "nil");
			}
		}
		return LuaState::expectedContext(lua, "graphic", "am.character");
	}
/**
	 * Sets the characters graphic, can be nil.
	 *
	 * @param am.sprite sprite The graphic to set.
	 * @returns am.character This
	 */
Sets the characters graphic, can be nil.
@param am.sprite sprite The graphic to set.
Sets the characters graphic can be nil . @param am . sprite sprite The graphic to set .
int Character_graphic(lua_State *lua)
	{
		Character *obj = castUData<Character>(lua, 1);
		if (obj)
		{
			if (lua_gettop(lua) == 1)
			{
				Sprite *sprite = obj->getGraphic();
				if (sprite)
				{
					wrapRefObject<Sprite>(lua, sprite);
				}
				else
				{
					lua_pushnil(lua);
				}
				return 1;
			}
			else
			{
				Sprite *sprite = nullptr;
				if (lua::gfx::getSprite(lua, 2, sprite))
				{
					obj->setGraphic(sprite);
					lua_first(lua);
				}
				return LuaState::expectedArgs(lua, "graphic", 3, "string asset_name", "am.sprite sprite", "nil");
			}
		}
		return LuaState::expectedContext(lua, "graphic", "am.character");
	}
int Character_graphic ( lua_State * lua ) { Character * obj = castUData < Character > ( lua , 1 ) ; if ( obj ) { if ( lua_gettop ( lua ) == 1 ) { Sprite * sprite = obj -> getGraphic ( ) ; if ( sprite ) { wrapRefObject < Sprite > ( lua , sprite ) ; } else { lua_pushnil ( lua ) ; } return 1 ; } else { Sprite * sprite = nullptr ; if ( lua :: gfx :: getSprite ( lua , 2 , sprite ) ) { obj -> setGraphic ( sprite ) ; lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , 3 , " " , " " , " " ) ; } } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Sets the characters graphic, can be nil.
Sets the characters graphic can be nil .