Gum
Gum copied to clipboard
[Gum] "Clips Children" doesn't work properly with rotation
- Create a
Parent
andText
object, makeText
child ofParent
- Add a lot of text to
Text
- Enable "Clips Children" on
Parent
- Rotate
Parent
Clipping will ignore the rotation so it will look broken.
Do you need clipping to respect rotation at 90 degree increments, or arbitrary angles? If 90i can implement a very quick fix. If any angle, it will take a little longer
I'm animating something (or trying to :D), so angles will be random. Better to wait until the proper solution is in place, for sure :).
I started on this by working on needing render targets to do rendering. This will allow an object to render itself to a render target and then to render that render target with rotation.
This is currently being worked on in Renderer.cs in this block of code:
if (renderable.ClipsChildren)
{
var userRenderTarget = false;
if(userRenderTarget)
{
var renderTarget = new RenderTarget2D(GraphicsDevice, 64, 64);
renderState.RenderTarget = renderTarget;
GraphicsDevice.SetRenderTarget(renderTarget);
GraphicsDevice.Clear(Color.Transparent);
shouldResetStates = true;
}
This work is in RenderTargetObjects branch.