Skip to content

Scaling with control nodes / UI #2

Description

@BaconEggsRL

Two tables side by side in an HBoxContainer will visually overlap with each other.
Tables do not seem to respect normal control node size boundaries.

To solve this I had to use a shader to prevent the tables from overlapping:

Table on right side: shader blocks SCREEN_UV < 0.5
Table on left side: shader blocks SCREEN_UV > 0.5


uniform float threshold : hint_range(0.0, 1.0) = 0.5;
uniform bool use_greater_than = false;

void fragment() {
    // Check if we should apply transparency based on the condition
    bool condition = use_greater_than ? (SCREEN_UV.x > threshold) : (SCREEN_UV.x < threshold);
    
    if (condition) {
        COLOR.a = 0.0;
    }
}```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions