Original Post
Hi everyone, I am new here but I am afraid I will be bothering you often in the near future
In the last couple of months I started to develop a simple "match 3" 2D game in XNA but I am now stuck with the following problem.
Long story short, the main game screen has a background and a "board area" where all the tiles are drawn, everything is working but I'd like to clip the board area so that objects that move out of it are not drawn over the background but are clipped.
I read that I could use the ScissorRectangle BUT I cannot manage it to work.
I tried the following approaches
- use the same SpriteBatch and set RasterizerState (with ScissorTestEnable set to true) -> no clipping occurs
- use a nested SpriteBatch for the board (even without ScissorRectangle set) -> board is not drawn!!!
So actually I have two questions
1. how can I have the ScissorRectangle working?
2. is there an explanation/tutorial/sample on how the various parameters of a SpriteBatch object affect rendering?
Thanks in advance, I hope to post some screenshots soon!!!
In the last couple of months I started to develop a simple "match 3" 2D game in XNA but I am now stuck with the following problem.
Long story short, the main game screen has a background and a "board area" where all the tiles are drawn, everything is working but I'd like to clip the board area so that objects that move out of it are not drawn over the background but are clipped.
I read that I could use the ScissorRectangle BUT I cannot manage it to work.
I tried the following approaches
- use the same SpriteBatch and set RasterizerState (with ScissorTestEnable set to true) -> no clipping occurs
- use a nested SpriteBatch for the board (even without ScissorRectangle set) -> board is not drawn!!!
So actually I have two questions
1. how can I have the ScissorRectangle working?
2. is there an explanation/tutorial/sample on how the various parameters of a SpriteBatch object affect rendering?
Thanks in advance, I hope to post some screenshots soon!!!