Add RayCast utility to UI controls

#1952
This commit is contained in:
Wojtek Figat
2024-02-26 16:22:56 +01:00
parent 996a2cb09e
commit f1fe83ca81
16 changed files with 168 additions and 12 deletions

View File

@@ -429,6 +429,23 @@ namespace FlaxEngine.GUI
return ContainsPoint(ref location);
}
/// <inheritdoc />
public override bool ContainsPoint(ref Float2 location, bool precise = false)
{
if (precise) // Ignore as utility-only element
return false;
return base.ContainsPoint(ref location, precise);
}
/// <inheritdoc />
public override bool RayCast(ref Float2 location, out Control hit)
{
var p = location / _scale;
if (RayCastChildren(ref p, out hit))
return true;
return base.RayCast(ref location, out hit);
}
/// <inheritdoc />
public override Float2 PointToParent(ref Float2 location)
{