Hi all,
I am new to Gideros, so my question may seem a bit naive.
I am building a UI and trying to insert a scroll view, i.e a frame with unlimited number of lines (sprites), but displayed only partly. On user touch events this list moves up and down but elements out of the frame are not displayed.
I didn't manage to find something like that out-of-the-box.
If you know a good library to do that simply, please stop reading and give me this reference
Anyway, I started to implement such a behavior, but I am stucked to this sprite cropping issue.
I need to set a shape (for example a rectangle) in which the sprite content will be displayed, without rescaling it.
For instance if I define a rectangle half as high as my sprite, only the top half of my sprite will be displayed.
How can I do such a thing?
This seems like something linked to the TextureRegion behaviour where only a part of the bitmap is displayed.
Any idea?
Thanks in advance
Comments
So Thank you for your tip but this is not quite what I need.
did you use render to texture?
I understand your point. But my window appears as a pop up so my background image appears with a little blur, and I need to take this in account. If not, my scroll item will appear between my frame window and the border of my screen.
I would like a better solution than make an image of my background + the grey rectangle above it + the frame window and make a cutout rectangle in the middle, because then I would need to rebuild it each time my background image changes...
Isn't there any way of cropping a sprite or defining a fixed size in which the content is displayed?
You can implement one big texture and manipulate it by TextureRegion
Likes: SpaceRider
http://www.indiedb.com/tutorials/clipping-in-gideros-with-rendertarget
it seems that you might need to use something like this to clip an area of the screen.
at the end of the tutorial there is also a class for clipping.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
on the other hand day by day there are people indirectly asking for this tutorial in different topics, so at least it seems it was worth to make it.
Fragmenter - animated loop machine and IKONOMIKON - the memory game