Files
sbox-public/engine/Sandbox.Engine/Scene/GameObjectSystems/DebugOverlay/DebugOverlaySystem.Texture.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

35 lines
953 B
C#

namespace Sandbox;
public partial class DebugOverlaySystem
{
/// <summary>
/// Draw a texture on the screen
/// </summary>
public void Texture( Texture texture, Vector2 position, Color? color = default, float duration = 0 )
{
var so = new QuadSceneObject( Scene.SceneWorld );
so.ColorTint = color ?? Color.White;
so.ScreenRect = new Rect( position, texture.Size );
so.Flags.CastShadows = false;
so.RenderLayer = SceneRenderLayer.OverlayWithoutDepth;
so.Texture = texture;
Add( duration, so );
}
/// <summary>
/// Draw a texture on the screen
/// </summary>
public void Texture( Texture texture, Rect screenRect, Color? color = default, float duration = 0 )
{
var so = new QuadSceneObject( Scene.SceneWorld );
so.ColorTint = color ?? Color.White;
so.ScreenRect = screenRect;
so.Flags.CastShadows = false;
so.RenderLayer = SceneRenderLayer.OverlayWithoutDepth;
so.Texture = texture;
Add( duration, so );
}
}