Created resource function and updated Sprite function.