How to get the sprite picker for an argument to our own function?

I’ve designed a Sprite class which wraps the sprite call with some other goodies (like rotation). The init method takes a sprite name, which it tucks away and then passes to sprite() inside its draw method.

All fine, except… now I can’t easily access the sprite picker when I instantiate my class. Codea, not surprisingly, doesn’t know that my argument in this context is the name of a sprite. Similar questions could arise for functions that need a sound.

Is there some trick I’m missing? Or do we need some keyboard widget or icon somewhere that summons any of these pickers on demand, regardless of context?

@JoeStrout Whenever I need to pick new sprites when testing, I add this in my code.

--[[
sprite()
--]]

A button on the keyboard that brings up an asset picker would be very handy, I’vw ran into the same problem multiple times. (Maybe make it copy the asset name, such as Cargo-Bot:Codea Icon, to the clipboard when you select it?)

In sprite() couldn’t you just manually type the address? For example sprite(documents/sprite.png).

Never actually tried it, but I don’t see why it wouldn’t work.

@Crumble You could, but it’s difficult when you have a long asset name, or multiple sprites to fill out (or don’t know the exact asset you want to use)

If I can add to this, I think when you save an image from the clipboard in the sprite picker you should be given the option to use it then. It’s not efficient to save the image then scroll through hundreds to find it.