77using SharpEngine . Core . Utils . EventArgs ;
88using MouseButton = SharpEngine . Core . Input . MouseButton ;
99using Color = SharpEngine . Core . Utils . Color ;
10+ using Microsoft . Win32 . SafeHandles ;
1011
1112namespace SharpEngine . Core . Widget ;
1213
@@ -18,15 +19,17 @@ namespace SharpEngine.Core.Widget;
1819/// <param name="font">Multi Line Edit Font ("")</param>
1920/// <param name="size">Multi Line Edit Size (Vec2(500, 200))</param>
2021/// <param name="fontSize">Multi Line Edit Font Size (null)</param>
22+ /// <param name="secret">If Multi Line Edit is Secret (false)</param>
2123/// <param name="zLayer">Z Layer</param>
2224public class MultiLineInput (
2325 Vec2 position ,
2426 string text = "" ,
2527 string font = "" ,
2628 Vec2 ? size = null ,
2729 int ? fontSize = null ,
30+ bool secret = false ,
2831 int zLayer = 0
29- ) : LineInput ( position , text , font , size , fontSize , zLayer )
32+ ) : LineInput ( position , text , font , size , fontSize , secret , zLayer )
3033{
3134 /// <inheritdoc />
3235 public override void Update ( float delta )
@@ -112,18 +115,19 @@ public override void Draw()
112115 ) ;
113116 }
114117
115- private static void DrawLines ( Font finalFont , int finalFontSize , Vec2 finalPosition , string [ ] lines , float offsetX , float offsetY )
118+ private void DrawLines ( Font finalFont , int finalFontSize , Vec2 finalPosition , string [ ] lines , float offsetX , float offsetY )
116119 {
117120 for ( var i = 0 ; i < lines . Length ; i ++ )
118121 {
119- var lineSize = Raylib . MeasureTextEx ( finalFont , lines [ i ] , finalFontSize , 2 ) ;
122+ var text = Secret ? new string ( '*' , lines [ i ] . Length ) : lines [ i ] ;
123+ var lineSize = Raylib . MeasureTextEx ( finalFont , text , finalFontSize , 2 ) ;
120124 var pos = new Vec2 (
121125 finalPosition . X - ( offsetX > 0 ? offsetX : 0 ) ,
122126 finalPosition . Y + i * lineSize . Y - ( offsetY > 0 ? offsetY : 0 )
123127 ) ;
124128 SERender . DrawText (
125129 finalFont ,
126- lines [ i ] ,
130+ text ,
127131 pos ,
128132 finalFontSize ,
129133 2 ,
0 commit comments