Not easily (that is under render to texture support is enabled), however depending on the exact requirements I suppose you *could* create some kind of dynamic shape and extend the boundaries to fit the area in which you want to fill.
WhiteTree Games - Home, home on the web, where the bits and bytes they do play! #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Here (http://code.opencv.org/projects/opencv/wiki/OpenCV4Android) it says OpenCV is supported on Android. A few students in a university here have developed OpenCV apps under Android - they coded an algorithm to read the license plate of moving cars - . I do not see a big reason not to implement OpenCV however it has >500 functions.
something like this? Here This is actually creating a buffer of smaller pixels and filling them up using flood fill. It would be nice if that could be done in the C code rather than lua code, better speed and performance.
That is exactly what I would like to do, But i would be using outlined png images. More of a coloring book style. Is there any sample code any where that I can look at for integrating a flood fill feature in Gideros?
One thing you could try would be to have a pre-processed set of images, for example, Imagine you have a picture with 15 discrete zones, you create 16 different images - the first one is the line drawing outline and the next 15 are smaller sub images that represent each area of colour and are colourised / shaded as required, what you would do would be to draw all the images in their correct positions but alpha them all out (except the first one), then as you detect a touch in an appropriate zone (maybe have a shape or a vertex list to handle the collision) you slowly alpha in the image - it wouldn't be a true flood fill but it would look nice - and you could disguise the effect even more by using a particle system to have some sparkly stars appear over the image. The other "advantage" would be that you could have some nice shading over the image which would otherwise be very difficult to do.
AND...
Before you shoot back that this would fix the colours of the image - you could draw each of the sub areas in white and then use the RGB colour transform section on the sub images to get a proper "colouring book" effect.
WhiteTree Games - Home, home on the web, where the bits and bytes they do play! #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
I was about to say that I sometimes use white png images and then use setColorTransform() to change their colours as I wish but @techdojo has just explained it better
I would use pre processed images, but for our art work require a lot of slicing and then positioning on the stage per image. @OZApps solution seems to be closer to what I am trying to accomplish. So far I have come to a few blog post, describing how to return rbg values from an image. I don't know if i'm going in the right direction in terms of building a plug in for android, and doing the same for iOS. Is there a simpler solution. Thank you guys for your help!
@agooey, while you might get some joy out of determining the rgb values from an image, it will not be very helpful as you would need to know what's on the screen while trying to floodfill. The most common way this is achieved is using pre-cut/sliced areas that are recoloured depending on the colour chosen.
If the API would allow for the getPixel and setPixel, then a lot can be done. What I have in the video is a buffer of smaller pixels (rects), so I cannot use an image on it, I am floodfilling as per the flood fill algorithm checking for the neighbouring pixels.
Comments
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Here
This is actually creating a buffer of smaller pixels and filling them up using flood fill. It would be nice if that could be done in the C code rather than lua code, better speed and performance.
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
Take away the "feature=player_embedded"
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
Imagine you have a picture with 15 discrete zones, you create 16 different images - the first one is the line drawing outline and the next 15 are smaller sub images that represent each area of colour and are colourised / shaded as required, what you would do would be to draw all the images in their correct positions but alpha them all out (except the first one), then as you detect a touch in an appropriate zone (maybe have a shape or a vertex list to handle the collision) you slowly alpha in the image - it wouldn't be a true flood fill but it would look nice - and you could disguise the effect even more by using a particle system to have some sparkly stars appear over the image. The other "advantage" would be that you could have some nice shading over the image which would otherwise be very difficult to do.
AND...
Before you shoot back that this would fix the colours of the image - you could draw each of the sub areas in white and then use the RGB colour transform section on the sub images to get a proper "colouring book" effect.
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Returning RBG Values Android Dev Blog
http://www.41post.com/3719/programming/android-how-to-return-rgb-values-from-an-image-file
while you might get some joy out of determining the rgb values from an image, it will not be very helpful as you would need to know what's on the screen while trying to floodfill. The most common way this is achieved is using pre-cut/sliced areas that are recoloured depending on the colour chosen.
If the API would allow for the getPixel and setPixel, then a lot can be done. What I have in the video is a buffer of smaller pixels (rects), so I cannot use an image on it, I am floodfilling as per the flood fill algorithm checking for the neighbouring pixels.
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