Hey i was wondering if anyone knows to do clipping with 2D textures for a gui or menu like system.
Heres an example output i would like to produce
Have a game screen with a size of 500 x 500. With a screen behind it with a size of 1000 x 1000.
When i draw a Texture at 0, 0 with the parent screen of 500 x 500 i would like the component not to be shown
but if i draw the component at 500, 450 and the texture width and height are 100 i would expect to only see the whole width but only half the height of the component.
I was wondering if there is an easy way about doing this?
Edit:
Basically i was thinking something like a mask effect in Photoshop.
here is a picture Clipping picture
The black outline is where the other half of the texture would be drawn.