Files
sbox-public/engine/Sandbox.Tools/ControlWidget/TransformControlWidget.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

43 lines
898 B
C#

namespace Editor;
[CustomEditor( typeof( Transform ) )]
public class TransformControlWidget : ControlWidget
{
SerializedObject obj;
public override bool SupportsMultiEdit => true;
public TransformControlWidget( SerializedProperty property ) : base( property )
{
property.TryGetAsObject( out obj );
Layout = Layout.Column();
Layout.Spacing = 2;
// Should we seperate these out somehow?
//Layout.Margin = new Sandbox.UI.Margin( 0, 2 );
// Position
{
Layout.Add( Create( obj.GetProperty( "Position" ) ) );
}
// Rotation
{
Layout.Add( Create( obj.GetProperty( "Rotation" ) ) );
}
// Scale
{
Layout.Add( Create( obj.GetProperty( "Scale" ) ) );
}
}
protected override void OnPaint()
{
// Paint.ClearPen();
// Paint.SetBrush( Color.Lerp( ControlColor.Lighten( 1.5f ), Theme.Blue, 0.10f ) );
// Paint.DrawRect( LocalRect, ControlRadius );
}
}