local ADD_REMOVE_ITEM = 150
system.registerActionPartHook(ADD_REMOVE_ITEM, "addRemoveItem")
function addRemoveItem(actionPart)
if actionPart.Int == 0 then
local path = actionPart.Link.Sprite.Sprite:getPath()
local sprite = graphics.loadFromFile(path)
sprite.position = graphics.getCharacterTextPosition(game.CurrentCharacter)
local t = getTime()
graphics.addDrawFunc("draw()", 0)
function draw()
local ct = getTime() - t
local alpha = 0
if ct > 3000 then
graphics.removeDrawFunc("draw()")
elseif ct > 2000 then
alpha = graphics.evalTween(1, 0, ct/1000-2,easeQuadOut)
elseif ct > 1000 then
alpha = 1
else
alpha = graphics.evalTween(0, 1, ct/1000,easeQuadOut)
end
graphics.drawSprite(sprite, alpha, 0xffffff)
end
end
return false
end