Digging into ToolSpawner.cs

A bit of a silly question, but I’m looking into the TooltipSpawner class in the utils of the Inventory RPG and I don’t understand something:

Lines 79-80:
bool below = transform.position.y > Screen.height / 2;
bool right = transform.position.x < Screen.width / 2;

Why should below return true if the y position is greater than Screen.height/2? The screen space is 0,0 in the bottom left, so shouldn’t it be the other way around?

Oh no, you’ve broken the whole system! (Just kidding)

Below and Right are the locations where we’ll be putting the tooltip. If the spawner is ABOVE the center, then we want to put the tooltip below the spawner. If the spawner is to the left of center, then we want the tooltip to the right of the spawner.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms