mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-03 03:48:24 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
35 lines
953 B
C#
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 );
|
|
}
|
|
}
|