合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
### 说明 DisplayScreen类表示游戏中的一块显示屏对象,其中LCD方块有唯一的一块显示屏,主控座椅有5块显示屏 ### 快速上手 ``` MEA.LCD lcd = new MEA.LCD("LCD"); // 实例化并获取LCD方块 Echo(lcd.Screen.ToString()); //输出LCD的屏幕对象 lcd.Screen.Text = "Hello World!"; //将LCD的屏幕对象的文本内容设为"Hello World!" lcd.Screen.FontColor = new Color(255,0,0); //将LCD的屏幕对象的文字颜色设为红色 ``` ### 继承 无 ### 构造方法 ``` // 通过LCD方块或主控座椅方块获取 MEA.LCD lcd = new MEA.LCD("LCD"); MEA.DisplayScreen sc = lcd.Screen; // 通过Cockpit获取 MEA.Cockpit cp = new MEA.Cockpit("Cockpit"); List<MEA.DisplayScreen> scs = cp.Screens; // 遍历然后操作 foreach(MEA.DisplayScreen s in scs){ s.Text = "Yes"; } ``` ### 属性 | 名称 | 类型 | 只读 | 含义 | | --- | --- | --- | --- | | _screen | IMyTextSurface | | 对应的IMyTextSurface实体 | Text | string | | 文本内容 | TextPadding | double | | 文字内边距 | Font | string | | 字体类型 | FontSize | double | | 字体大小 | FontColor | Color | | 文字颜色 | BackgroundColor | Color | | 背景颜色 | BackgroundAlpha | byte | | 背景透明度(类似int,范围0-255) | ScriptBackgroundColor | Color | | 脚本背景颜色 | ScriptForegroundColor | Color | | 脚本前景颜色 | ChangeInterval | double | | 切换时间间隔 | Alignment | TextAlignment | | 对齐方式,有TextAlignment.LEFT、TextAlignment.RIGHT、TextAlignment.CENTER | Script | string | | 当前脚本 | ContentType | VRage.Game.GUI.TextPanel.ContentType:byte | | 显示类型,有:NONE = 0、 TEXT_AND_IMAGE = 1、SCRIPT = 3 | SurfaceSize | Vector2I | 是 | 屏幕尺寸(像素) | TextureSize | Vector2I | 是 | 图像尺寸 | PreserveAspectRatio | bool | | 是否保持长宽比 | CurrentlyShownImage | string | 是 | 当前显示的图像 | Name | string | 是 | 屏幕名称 | DisplayName | string | 是 | 屏幕显示名称 ### 方法 * 获取所有字体列表: void GetFonts(List fonts); ``` MEA.LCD lcd = new MEA.LCD("LCD"); List<string> fonts = new List<string>(); lcd.Screen.GetFonts(fonts); //此时fonts中储存了该LCD屏幕可选的所有字体类型 ``` * 获取所有脚本列表: voidGetScripts(List scripts) ``` MEA.LCD lcd = new MEA.LCD("LCD"); List<string> scripts = new List<string>(); lcd.Screen.voidGetScripts(scripts); //此时scripts中储存了该LCD屏幕可选的所有脚本类型 ``` * 获取选中的图像列表: GetSelectedImages(List output) ``` MEA.LCD lcd = new MEA.LCD("LCD"); List<string> output = new List<string>(); lcd.Screen.GetSelectedImages(output); //此时scripts中储存了该LCD屏幕可选的所有脚本类型 ```