Howdy, Stranger!

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

Allowing users to select a image from their pictures

edited October 2013 in Questions Posts: 577

How could I draw, on screen, a image a user selected?

For example, lets say I wanted to make a app, where someone could search through their pictures, select it, and draw crazy shapes on it.

Is that possible in codea?

Thanks, Prynok


  • Posts: 1,595

    Only possible with spriteList, that gives you a list of all images stored by codea

  • Posts: 577

    @Luatee so would the user have to take a image inside of codea, or open one they made outside of it?

  • dave1707dave1707 Mod
    edited October 2013 Posts: 8,780

    @Prynok They could import all of their pictures into the Documents folder Photo Library. Then you could read their pictures and let them select which one they want.

  • Posts: 577

    How could I add that, would it use spriteList?

  • dave1707dave1707 Mod
    Posts: 8,780

    @Prynok There's nothing to add, it's already part of the iPad. They would import the pictures from a memory card using the card adapter that plugs into the iPad. They would load the pictures using the Photo Library in the Documents folder, then save them for your program to read.

  • edited October 2013 Posts: 1,976

    Somewhere, I posted a sprite picker I made... I'll quickly fix something I forgot about in it and gist it.

  • Posts: 1,976

    Okay, it's pretty old, has messy code, and for some reason can't seem to get over 12 FPS, and doesn't have smooth scrolling (which I always do nowadays), but here it is, my old sprite picker:

    I might make a faster, newer one sometime. Once SkyUI comes out. (Spoilers!)

  • BriarfoxBriarfox Mod
    Posts: 1,542

    I used a sprite picker for the project Particular Particles. I used coroutines to speed it up, well at least make it appear that it was faster. I'll see if I can separate it out.

  • Posts: 1,255

    Going back to the original question, there have long been requests for direct access to photos from Codea. For example, it would be spiffy to let the user (not the developer) select an image for an avatar in a game. Personally, I want to pull in images and do edge analysis to test for proper post-blast framentation of strata (yeah, that's just me).

    But no matter the reason, there's long been concern about how Apple's standard photo access tools would play alongside Codea's draw cycle. So at the moment, you can do it from the developer side, but direct access to the photo folder from the user perspective isn't available.

Sign In or Register to comment.