Skip to content

VfxWidgetGroup. When rendering to a Stage with offsetted viewport - actors are clipped by viewport offset. #28

Description

@DirolTerminator

Not sure if it can be repeated on a clean project, but I'll leave it here for further research and testing.

  1. Correct rendering
public void render() {
		stage.getViewport().setScreenBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); 
		stage.getViewport().apply(true);
		stage.act(Gdx.graphics.getDeltaTime());
		stage.draw();
}    

Result is:
https://imgshare.cc/3juuc570

  1. Incorrect rendering
public void render() {
		stage.getViewport().setScreenBounds(30, 20, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); 
		stage.getViewport().apply(true);
		stage.act(Gdx.graphics.getDeltaTime());
		stage.draw();
}    

Result is clipped actors by x=30 and y=20 respectively:
https://imgshare.cc/3pntjv8d

Actors which got clipped are specifically VerticalGroups, nested inside Window (all instances of WidgetGroup, consisting of other child actors) if thats matters. It seems that renderer applies viewport offset to each WidgetGroup separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions