How can I display some parts of a display image?

Hi,

I have a 20x100 image in my game. I want to be able to show different percentages of the image. For example be able to show some percentage of it, like 20% of it. I don’t want to scale it or something, just see 20% of it, for example just see legs of my character then see the image from legs to his neck and like that.

Does corona support such thing? [import]uid: 206803 topic_id: 37135 reply_id: 67135[/import]

You could either use bitmap masks, swapping different ones out each time you need to see a different portion of the image, or cover the image with black rectangles which you then hide as required.

http://developer.coronalabs.com/reference/bitmap-mask [import]uid: 93133 topic_id: 37135 reply_id: 145382[/import]

A good solution is to use image-sheets
http://www.coronalabs.com/blog/2012/03/06/image-sheets-image-groups-and-sprites/ [import]uid: 138389 topic_id: 37135 reply_id: 145405[/import]

@vovasoft

Thanks but I need to be able to do it on animated sprites as well.

What I’m trying to do is this: I have an animated sprite that I need to make some arbitrary percentages of it grayscale during gameplay.

But I can’t get my head around figuring out how to do it. [import]uid: 206803 topic_id: 37135 reply_id: 145483[/import]

So my question is, is it possible to grayscale some parts of an animated sprite with masks? [import]uid: 206803 topic_id: 37135 reply_id: 145546[/import]

You could either use bitmap masks, swapping different ones out each time you need to see a different portion of the image, or cover the image with black rectangles which you then hide as required.

http://developer.coronalabs.com/reference/bitmap-mask [import]uid: 93133 topic_id: 37135 reply_id: 145382[/import]

A good solution is to use image-sheets
http://www.coronalabs.com/blog/2012/03/06/image-sheets-image-groups-and-sprites/ [import]uid: 138389 topic_id: 37135 reply_id: 145405[/import]

@vovasoft

Thanks but I need to be able to do it on animated sprites as well.

What I’m trying to do is this: I have an animated sprite that I need to make some arbitrary percentages of it grayscale during gameplay.

But I can’t get my head around figuring out how to do it. [import]uid: 206803 topic_id: 37135 reply_id: 145483[/import]

So my question is, is it possible to grayscale some parts of an animated sprite with masks? [import]uid: 206803 topic_id: 37135 reply_id: 145546[/import]