コード例 #1
0
 public override void Resize(int width, int height)
 {
     base.Resize(width, height);
     mainLayout.Pack(300);
     bottomLayout.Pack(600);
     bottomRightLayout.Pack((1024 - bottomLayout.Width) / 2);
 }
コード例 #2
0
ファイル: ProjectMenu.cs プロジェクト: thyawan/storybrew
        private void project_OnEffectsStatusChanged(object sender, EventArgs e)
        {
            switch (project.EffectsStatus)
            {
            case EffectStatus.ExecutionFailed:
                statusIcon.Icon    = IconFont.Bug;
                statusMessage.Text = "An effect failed to execute.\nClick the Effects tabs, then the bug icon to see its error message.";
                statusLayout.Pack(1024 - bottomRightLayout.Width - 24);
                statusLayout.Displayed = true;
                break;

            case EffectStatus.Updating:
                statusIcon.Icon    = IconFont.Spinner;
                statusMessage.Text = "Updating effects...";
                statusLayout.Pack(1024 - bottomRightLayout.Width - 24);
                statusLayout.Displayed = true;
                break;

            default:
                statusLayout.Displayed = false;
                break;
            }
        }
コード例 #3
0
ファイル: ProjectMenu.cs プロジェクト: thyawan/storybrew
        public override void Resize(int width, int height)
        {
            base.Resize(width, height);

            bottomRightLayout.Pack(374);
            bottomLeftLayout.Pack(WidgetManager.Size.X - bottomRightLayout.Width);

            settingsMenu.Pack(bottomRightLayout.Width - 24, WidgetManager.Root.Height - bottomRightLayout.Height - 16);
            effectsList.Pack(bottomRightLayout.Width - 24, WidgetManager.Root.Height - bottomRightLayout.Height - 16);
            layersList.Pack(bottomRightLayout.Width - 24, WidgetManager.Root.Height - bottomRightLayout.Height - 16);

            effectConfigUi.Pack(bottomRightLayout.Width, WidgetManager.Root.Height - bottomLeftLayout.Height - 16);
            resizeStoryboard();
        }
コード例 #4
0
ファイル: UpdateMenu.cs プロジェクト: thyawan/storybrew
 public override void Resize(int width, int height)
 {
     base.Resize(width, height);
     mainLayout.Pack(300, 0);
 }
コード例 #5
0
 public override void Resize(int width, int height)
 {
     base.Resize(width, height);
     mainLayout.Pack(400, 0, 1024 - 32, 768 - 32);
 }
コード例 #6
0
 public override void Resize(int width, int height)
 {
     base.Resize(width, height);
     layout.Pack(Math.Min(400, width), Math.Min(600, height));
 }
コード例 #7
0
        private void initializeOverlay()
        {
            overlay.Root.ClearWidgets();

            overlay.Root.Add(overlayTop = new LinearLayout(overlay)
            {
                AnchorTarget = overlay.Root,
                AnchorFrom   = BoxAlignment.Top,
                AnchorTo     = BoxAlignment.Top,
                Horizontal   = true,
                Opacity      = 0,
                Displayed    = false,
                Children     = new Widget[]
                {
                    statsLabel = new Label(overlay)
                    {
                        StyleName = "small",
                        AnchorTo  = BoxAlignment.Centre,
                        Displayed = Program.Settings.ShowStats,
                    },
                }
            });
            overlayTop.Pack(1024, 16);

            overlay.Root.Add(altOverlayTop = new LinearLayout(overlay)
            {
                AnchorTarget = overlay.Root,
                AnchorFrom   = BoxAlignment.Top,
                AnchorTo     = BoxAlignment.Top,
                Horizontal   = true,
                Opacity      = 0,
                Displayed    = false,
                Children     = new Widget[]
                {
                    new Label(overlay)
                    {
                        StyleName = "icon",
                        Icon      = IconFont.VolumeUp,
                        AnchorTo  = BoxAlignment.Centre,
                    },
                    volumeSlider = new Slider(overlay)
                    {
                        Step     = 0.01f,
                        AnchorTo = BoxAlignment.Centre,
                    },
                }
            });
            altOverlayTop.Pack(0, 0, 1024);

            Program.Settings.Volume.Bind(volumeSlider, () => volumeSlider.Tooltip = $"Volume: {volumeSlider.Value:P0}");
            overlay.Root.OnMouseWheel += (sender, e) =>
            {
                if (!InputManager.AltOnly)
                {
                    return(false);
                }

                volumeSlider.Value += e.DeltaPrecise * 0.05f;
                return(true);
            };
        }