Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gum] "Clips Children" doesn't work properly with rotation #105

Open
Arcnor opened this issue Oct 8, 2023 · 4 comments
Open

[Gum] "Clips Children" doesn't work properly with rotation #105

Arcnor opened this issue Oct 8, 2023 · 4 comments

Comments

@Arcnor
Copy link
Collaborator

Arcnor commented Oct 8, 2023

  1. Create a Parent and Text object, make Text child of Parent
  2. Add a lot of text to Text
  3. Enable "Clips Children" on Parent
  4. Rotate Parent

Clipping will ignore the rotation so it will look broken.

@vchelaru
Copy link
Owner

vchelaru commented Oct 9, 2023

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

@Arcnor
Copy link
Collaborator Author

Arcnor commented Oct 9, 2023

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 :).

@vchelaru vchelaru transferred this issue from vchelaru/FlatRedBall Oct 9, 2023
@vchelaru
Copy link
Owner

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;
    }

@vchelaru
Copy link
Owner

This work is in RenderTargetObjects branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants