本文整理匯總了C#中Sandbox.Graphics.GUI.MyGuiControlLabel.UpdateFormatParams方法的典型用法代碼示例。如果您正苦於以下問題:C# MyGuiControlLabel.UpdateFormatParams方法的具體用法?C# MyGuiControlLabel.UpdateFormatParams怎麽用?C# MyGuiControlLabel.UpdateFormatParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sandbox.Graphics.GUI.MyGuiControlLabel
的用法示例。
在下文中一共展示了MyGuiControlLabel.UpdateFormatParams方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RecreateControls
public override void RecreateControls(bool constructor)
{
if (!constructor)
return;
base.RecreateControls(constructor);
AddCaption(MySpaceTexts.ScreenCaptionVideoOptions);
Vector2 controlsOriginLeft = new Vector2(-m_size.Value.X / 2.0f + 0.05f, -m_size.Value.Y / 2.0f + 0.145f) + new Vector2(0.02f, 0f);
Vector2 controlsOriginRight = new Vector2(-m_size.Value.X / 2.0f + 0.225f, -m_size.Value.Y / 2.0f + 0.145f) + new Vector2(0.043f, 0f);
const float TEXT_SCALE = MyGuiConstants.DEFAULT_TEXT_SCALE * 0.85f;
var labelVideoAdapter = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.VideoAdapter));
var labelVideoMode = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.VideoMode));
var labelWindowMode = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.ScreenOptionsVideo_WindowMode));
var labelVSync = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.VerticalSync));
var labelHwCursor = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.HardwareCursor));
var labelRenderQuality = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.RenderQuality));
var labelFoV = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.FieldOfView));
m_fieldOfViewDefaultLabel = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.DefaultFOV));
var labelRenderInterpolation = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.RenderIterpolation));
var labelEnableDamageEffects = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.EnableDamageEffects));
m_videoAdapterCombobox = new MyGuiControlCombobox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsVideoAdapter));
m_resolutionCombobox = new MyGuiControlCombobox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsVideoMode));
m_windowModeCombobox = new MyGuiControlCombobox();
m_verticalSyncCheckbox = new MyGuiControlCheckbox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsVerticalSync));
m_hardwareCursorCheckbox = new MyGuiControlCheckbox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsHardwareCursor));
m_enableDamageEffectsCheckbox = new MyGuiControlCheckbox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsEnableDamageEffects));
m_renderQualityCombobox = new MyGuiControlCombobox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsRenderQuality));
m_fieldOfViewSlider = new MyGuiControlSlider(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsFieldOfView),
labelText: new StringBuilder("{0}").ToString(),
labelSpaceWidth: 0.035f,
labelScale: TEXT_SCALE,
labelFont: MyFontEnum.Blue,
minValue: MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_MIN),
maxValue: MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_MAX),
defaultValue: MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_DEFAULT));
m_renderInterpolationCheckbox = new MyGuiControlCheckbox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionRenderIterpolation));
m_unsupportedAspectRatioLabel = new MyGuiControlLabel(colorMask: MyGuiConstants.LABEL_TEXT_COLOR * 0.9f, textScale: TEXT_SCALE * 0.85f);
m_recommendAspectRatioLabel = new MyGuiControlLabel(colorMask: MyGuiConstants.LABEL_TEXT_COLOR * 0.9f, textScale: TEXT_SCALE * 0.85f);
var hintLineOffset = new Vector2(0f, m_unsupportedAspectRatioLabel.Size.Y);
var hintOffset = new Vector2(0.01f, -0.35f * MyGuiConstants.CONTROLS_DELTA.Y);
labelVideoAdapter.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_videoAdapterCombobox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
labelVideoMode.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_resolutionCombobox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
m_unsupportedAspectRatioLabel.Position = controlsOriginRight + hintOffset;
m_recommendAspectRatioLabel.Position = controlsOriginRight + hintOffset + hintLineOffset;
controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
labelWindowMode.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_windowModeCombobox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
labelVSync.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_verticalSyncCheckbox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
labelHwCursor.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_hardwareCursorCheckbox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
labelRenderQuality.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_renderQualityCombobox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
labelRenderInterpolation.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_renderInterpolationCheckbox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
labelEnableDamageEffects.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_enableDamageEffectsCheckbox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
labelFoV.Position = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
m_fieldOfViewSlider.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
m_fieldOfViewDefaultLabel.Position = controlsOriginRight + hintOffset;
Controls.Add(labelVideoAdapter); Controls.Add(m_videoAdapterCombobox);
Controls.Add(labelVideoMode); Controls.Add(m_resolutionCombobox);
Controls.Add(m_unsupportedAspectRatioLabel);
Controls.Add(m_recommendAspectRatioLabel);
Controls.Add(labelWindowMode); Controls.Add(m_windowModeCombobox);
Controls.Add(labelVSync); Controls.Add(m_verticalSyncCheckbox);
Controls.Add(labelHwCursor); Controls.Add(m_hardwareCursorCheckbox);
Controls.Add(labelRenderQuality); Controls.Add(m_renderQualityCombobox);
Controls.Add(labelRenderInterpolation); Controls.Add(m_renderInterpolationCheckbox);
Controls.Add(labelEnableDamageEffects); Controls.Add(m_enableDamageEffectsCheckbox);
Controls.Add(labelFoV); Controls.Add(m_fieldOfViewSlider);
Controls.Add(m_fieldOfViewDefaultLabel);
foreach (var control in Controls)
control.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;
m_unsupportedAspectRatioLabel.Text = string.Format("* {0}", MyTexts.Get(MySpaceTexts.UnsupportedAspectRatio));
AddAdaptersToComboBox();
AddRenderQualitiesToComboBox();
AddWindowModesToComboBox();
m_fieldOfViewDefaultLabel.UpdateFormatParams(MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_DEFAULT));
//.........這裏部分代碼省略.........
示例2: RecreateControls
//.........這裏部分代碼省略.........
m_comboAntialiasing.AddItem((int)MyAntialiasingMode.NONE, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_AntiAliasing_None));
m_comboAntialiasing.AddItem((int)MyAntialiasingMode.FXAA, "FXAA");
//m_comboAntialiasing.AddItem((int)MyAntialiasingMode.MSAA_2, "MSAA 2x");
//m_comboAntialiasing.AddItem((int)MyAntialiasingMode.MSAA_4, "MSAA 4x");
//m_comboAntialiasing.AddItem((int)MyAntialiasingMode.MSAA_8, "MSAA 8x");
m_comboShadowMapResolution.AddItem((int)MyShadowsQuality.DISABLED, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_ShadowMapResolution_Disabled));
m_comboShadowMapResolution.AddItem((int)MyShadowsQuality.LOW, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_ShadowMapResolution_Low));
m_comboShadowMapResolution.AddItem((int)MyShadowsQuality.MEDIUM, MyTexts.GetString(MySpaceTexts.ScreenGraphicsOptions_ShadowMapResolution_Medium));
m_comboShadowMapResolution.AddItem((int)MyShadowsQuality.HIGH, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_ShadowMapResolution_High));
m_comboTextureQuality.AddItem((int)MyTextureQuality.LOW, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_TextureQuality_Low));
m_comboTextureQuality.AddItem((int)MyTextureQuality.MEDIUM, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_TextureQuality_Medium));
m_comboTextureQuality.AddItem((int)MyTextureQuality.HIGH, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_TextureQuality_High));
m_comboAnisotropicFiltering.AddItem((int)MyTextureAnisoFiltering.NONE, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_AnisotropicFiltering_Off));
m_comboAnisotropicFiltering.AddItem((int)MyTextureAnisoFiltering.ANISO_1, "1x");
m_comboAnisotropicFiltering.AddItem((int)MyTextureAnisoFiltering.ANISO_4, "4x");
m_comboAnisotropicFiltering.AddItem((int)MyTextureAnisoFiltering.ANISO_8, "8x");
m_comboAnisotropicFiltering.AddItem((int)MyTextureAnisoFiltering.ANISO_16, "16x");
m_comboFoliageDetails.AddItem((int)MyFoliageDetails.DISABLED, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_FoliageDetails_Disabled));
m_comboFoliageDetails.AddItem((int)MyFoliageDetails.LOW, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_FoliageDetails_Low));
m_comboFoliageDetails.AddItem((int)MyFoliageDetails.MEDIUM, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_FoliageDetails_Medium));
m_comboFoliageDetails.AddItem((int)MyFoliageDetails.HIGH, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_FoliageDetails_High));
m_comboVoxelQuality.AddItem((int)MyRenderQualityEnum.LOW, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_FoliageDetails_Low));
m_comboVoxelQuality.AddItem((int)MyRenderQualityEnum.NORMAL, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_FoliageDetails_Medium));
m_comboVoxelQuality.AddItem((int)MyRenderQualityEnum.HIGH, MyTexts.GetString(MyCommonTexts.ScreenGraphicsOptions_FoliageDetails_High));
for (int i = 0; i < m_renderers.Length; i++)
m_comboRenderer.AddItem(i, m_renderers[i]);
labelFovDefault.UpdateFormatParams(MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_DEFAULT));
var table = new MyLayoutTable(this);
{
const float h = 60f;
table.SetColumnWidths(60f, 400f, 460f);
table.SetRowHeights(100f, h, h, h, h, h, 40f, h, h, h, h, h, h, h, h, h, 120f);
}
int row = 1;
const int leftCol = 1;
const int rightCol = 2;
const MyAlignH hAlign = MyAlignH.Left;
const MyAlignV vAlign = MyAlignV.Center;
table.Add(labelRenderer, hAlign, vAlign, row, leftCol);
table.Add(m_comboRenderer, hAlign, vAlign, row++, rightCol);
table.Add(labelHwCursor, hAlign, vAlign, row, leftCol);
table.Add(m_checkboxHardwareCursor, hAlign, vAlign, row++, rightCol);
table.Add(labelRenderInterpolation, hAlign, vAlign, row, leftCol);
table.Add(m_checkboxRenderInterpolation, hAlign, vAlign, row++, rightCol);
table.Add(labelEnableDamageEffects, hAlign, vAlign, row, leftCol);
table.Add(m_checkboxEnableDamageEffects, hAlign, vAlign, row++, rightCol);
table.Add(labelFov, hAlign, vAlign, row, leftCol);
table.Add(m_sliderFov, hAlign, vAlign, row++, rightCol);
table.Add(labelFovDefault, hAlign, MyAlignV.Top, row++, rightCol);
if (MyVideoSettingsManager.RunningGraphicsRenderer == MySandboxGame.DirectX11RendererKey)
{
table.Add(labelGraphicsPresets, hAlign, vAlign, row, leftCol);
table.Add(m_comboGraphicsPresets, hAlign, vAlign, row++, rightCol);
table.Add(labelAntiAliasing, hAlign, vAlign, row, leftCol);
table.Add(m_comboAntialiasing, hAlign, vAlign, row++, rightCol);
table.Add(labelShadowMapResolution, hAlign, vAlign, row, leftCol);
table.Add(m_comboShadowMapResolution, hAlign, vAlign, row++, rightCol);