Allowing users to select a image from their pictures

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

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

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

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

How could I add that, would it use spriteList?

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

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

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: https://gist.github.com/SkyTheCoder/6786653

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

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.

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.