lua/wrappers/game/lua_door.cpp
/**
	 * Sets the door asset graphic.
	 * Sets the asset_name of the graphic for this door.
	 *
	 * @param string asset_name The asset name to the graphic.
	 * @returns am.door This
	 */
Sets the door asset graphic.
Sets the asset_name of the graphic for this door.

@param string asset_name The asset name to the graphic.
Sets the door asset graphic . Sets the asset_name of the graphic for this door . @param string asset_name The asset name to the graphic .
int Door_graphic(lua_State *lua)
	{
		Door *door = castUData<Door>(lua, 1);
		if (door)
		{
			if (lua_gettop(lua) == 1)
			{
				Sprite *sprite = door->getGraphic();
				if (sprite)
				{
					wrapRefObject<Sprite>(lua, sprite);
				}
				else
				{
					lua_pushnil(lua);
				}
				return 1;
			}
			else
			{
				Sprite *sprite = nullptr;
				if (gfx::getSprite(lua, 2, sprite))
				{
					door->setGraphic(sprite);
					lua_first(lua);
				}
				return LuaState::expectedArgs(lua, "graphic", 3, "am.sprite sprite", "string asset_name", "nil");
			}
		}
		return LuaState::expectedContext(lua, "graphic", "am.door");
	}
int Door_graphic ( lua_State * lua ) { Door * door = castUData < Door > ( lua , 1 ) ; if ( door ) { if ( lua_gettop ( lua ) == 1 ) { Sprite * sprite = door -> getGraphic ( ) ; if ( sprite ) { wrapRefObject < Sprite > ( lua , sprite ) ; } else { lua_pushnil ( lua ) ; } return 1 ; } else { Sprite * sprite = nullptr ; if ( gfx :: getSprite ( lua , 2 , sprite ) ) { door -> setGraphic ( sprite ) ; lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , 3 , " " , " " , " " ) ; } } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Sets the door asset graphic.
Sets the door asset graphic .