I was thinking of the possibility of using the Media class (getPixel & setPixel) that is currently in the Labs with a floodfill algorithm. This would be used for a coloring book app. Do you think the performance would sufferer, especially when you get to the large high res tablets? Any thoughts?
Comments
But in relatity, when LuaJIT will come, it pretty much won't matter if it is run in Lua or natively
I had not seen the list of functionality included in Media Plugin. Just ran the same to check it, here's a couple to things
1. It's amazing
2. (this is device and OS specific) but when you take a image and then select use, it is a while before it responds, and it seems like the app has crashed/hung. I've faced that with another app of mine earlier.
3. The media:save() where does it save, can this be altered (I can have a peek, but if this was specified, it would help)
4. The Images snapped are usually 90 degrees, dunno why but it has happened with a previous app of mine.
5. Take Picture (without the resize flag) is generally always just BLACK, I guess that could have something to do with the device being Low or out of memory, after all even on the iPhone4, the images are about 2-3 MB
6. Take Screenshot is also pitch black, so there is something that is not working, either out of memory or some code issue.
7. As the lag between the tap and the functionality of the button pressed in the demo, if anyone is interested, they can add these few lines to make it a bit more understandable/manageable.
just after the function createText and before the --here we will store Bitmap isntance, add the following lines
You can also add it to the checkCamera function as
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
That brings us back to the old (unanswered) question, can we convert UIImage or such into a Gideros Image? Or is the only way to manipulate an image, save it as a png and then load the png into Gideros?
The problem being loading an image is generally expected to be from the resources directory only
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
3) when you create media object you either provide path (then save saves file to this path) or dimensions, then the file name is automatically generated.
You can get the path using media:getPath() method
Additionally you can create a copy and save where you want it to be, using media:copy(newPath)
4) I can actually never predict in which orientation user takes the photo in. So all photos are passed as they are. Additionally you can provide an option to rotate the photo in your app, using media:rotate(degree) method
5) This also could be a problem that texture is so big that it can be loaded into Gideros due to hardware limitations. Ok then what I think can be done is to provide the dimensions you want to resize photo to
6) On IOS you need to enable additional option if you want screenshots:
If you need screenshots then change:
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO]
to YES
inside EAGLView.m method - (id)initWithFrame:(CGRect)rect
It is not optimal nor efficient solution, but it would have to do for now, till we are working on making it more efficient
Also to make it crossplatform, the api was made that it only can be loaded from saved images, and not from platform specific objects like Android Bitmap or IOS UIImage
And why would you think that image should only be expected from Resource directory?
Bitmap also accepts global paths
Likes: MoKaLux
as I said in point #1. it's amazing, I dug deeper into the plug-in source to have a look
and some of the questions were answered there, specially in respect to the UIimage -> Save -> Load as Bitmap Texture in Gideros, because that's how it is being done and you have confirmed that too. I am not sure about how much time we can save (optimize) by avoiding that save/load and pass as Gideros CImage (equivalent) directly.
Delay and rotation (I was providing you details, that it is common) it happens and you cannot do much about it, so if that is an issue, it is a feature with iOS.
the only problem with Video playback is the orientation, but this is wonderful for in-game videos and for continuity between levels and start/end of the game, intro, etc.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps