lua/wrappers/game/lua_item.cpp
/**
	 * Sets the ground graphic by asset name for the item, can be set to nil.
	 *
	 * @param string asset_name The asset name for the new ground graphic for the item.
	 * @returns am.item This
	 */
Sets the ground graphic by asset name for the item, can be set to nil.
@param string asset_name The asset name for the new ground graphic for the item.
Sets the ground graphic by asset name for the item can be set to nil . @param string asset_name The asset name for the new ground graphic for the item .
int Item_ground_graphic(lua_State *lua)
	{
		Item *item = castUData<Item>(lua, 1);
		if (item)
		{
			if (lua_gettop(lua) == 1)
			{
				Sprite *graphic = item->getGroundGraphic();
				if (graphic)
				{
					wrapRefObject<Sprite>(lua, graphic);
					return 1;
				}
			}
			else if (lua_isnil(lua, 2))
			{
				item->setGroundGraphic(nullptr);
				lua_first(lua);
			}
			else
			{
				Sprite *sprite = nullptr;
				if (lua::gfx::getSprite(lua, 2, sprite))
				{
					item->setGroundGraphic(sprite);
					lua_first(lua);
				}
			}
			return LuaState::expectedArgs(lua, "ground_graphic", 3, "am.sprite graphic", "string asset_name", "nil graphic");
		}
		return LuaState::expectedContext(lua, "ground_graphic", "am.item");
	}
int Item_ground_graphic ( lua_State * lua ) { Item * item = castUData < Item > ( lua , 1 ) ; if ( item ) { if ( lua_gettop ( lua ) == 1 ) { Sprite * graphic = item -> getGroundGraphic ( ) ; if ( graphic ) { wrapRefObject < Sprite > ( lua , graphic ) ; return 1 ; } } else if ( lua_isnil ( lua , 2 ) ) { item -> setGroundGraphic ( nullptr ) ; lua_first ( lua ) ; } else { Sprite * sprite = nullptr ; if ( lua :: gfx :: getSprite ( lua , 2 , sprite ) ) { item -> setGroundGraphic ( sprite ) ; lua_first ( lua ) ; } } return LuaState :: expectedArgs ( lua , " " , 3 , " " , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Sets the ground graphic by asset name for the item, can be set to nil.
Sets the ground graphic by asset name for the item can be set to nil .