Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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?

Tagged:

Comments

  • dave1707dave1707 Mod
    edited February 2015 Posts: 7,753

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

    --[[
    sprite()
    --]]
    
  • Posts: 1,976

    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?)

  • edited February 2015 Posts: 300

    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.

  • Posts: 1,976

    @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)

  • Posts: 1,595

    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.

Sign In or Register to comment.