Ejemplo n.º 1
0
        private void load(HoloTrackConfigManager config)
        {
            userScale   = config.GetBindable <float>(HoloTrackSetting.ModelScale);
            userXOffset = config.GetBindable <float>(HoloTrackSetting.ModelPositionX);
            userYOffset = config.GetBindable <float>(HoloTrackSetting.ModelPositionY);

            allowMouseDrag   = config.GetBindable <bool>(HoloTrackSetting.MouseDrag);
            allowMouseScroll = config.GetBindable <bool>(HoloTrackSetting.MouseWheel);

            asset = config.GetBindable <string>(HoloTrackSetting.Model);

            userScale.ValueChanged   += _ => updateRenderer();
            userXOffset.ValueChanged += _ => updateRenderer();
            userYOffset.ValueChanged += _ => updateRenderer();

            asset.ValueChanged += _ => updateModel();

            updateModel();
        }
Ejemplo n.º 2
0
        private void load(HoloTrackConfigManager config)
        {
            userScale   = config.GetBindable <float>(HoloTrackSetting.BackgroundScale);
            userXOffset = config.GetBindable <float>(HoloTrackSetting.BackgroundPositionX);
            userYOffset = config.GetBindable <float>(HoloTrackSetting.BackgroundPositionY);

            backgroundMode = config.GetBindable <BackgroundMode>(HoloTrackSetting.BackgroundMode);
            userTexture    = config.GetBindable <string>(HoloTrackSetting.BackgroundImage);
            userColor      = config.GetBindable <Colour4>(HoloTrackSetting.BackgroundColor);

            userScale.ValueChanged   += _ => updateTranslation();
            userXOffset.ValueChanged += _ => updateTranslation();
            userYOffset.ValueChanged += _ => updateTranslation();

            backgroundMode.ValueChanged += _ => updateTexture();
            userTexture.ValueChanged    += _ => updateTexture();
            userColor.ValueChanged      += _ => updateTexture();

            updateTranslation();
            updateTexture();
        }
Ejemplo n.º 3
0
        private void load(HoloTrackConfigManager config)
        {
            Add(new SettingsSliderBar <float>
            {
                Label    = @"Scale",
                Bindable = config.GetBindable <float>(HoloTrackSetting.ModelScale)
            });

            Add(new FillFlowContainer
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Spacing          = new Vector2(0, 5),
                Direction        = FillDirection.Vertical,
                Children         = new Drawable[]
                {
                    new HoloTrackSpriteText
                    {
                        Text = @"Position"
                    },
                    new GridContainer
                    {
                        Height           = 25,
                        RelativeSizeAxes = Axes.X,
                        ColumnDimensions = new[]
                        {
                            new Dimension(GridSizeMode.Distributed),
                            new Dimension(GridSizeMode.Distributed),
                        },
                        Content = new[]
                        {
                            new Drawable[]
                            {
                                new SettingsBadgedNumberBox <float>
                                {
                                    Width     = 0.75f,
                                    BadgeText = @"X",
                                    Bindable  = config.GetBindable <float>(HoloTrackSetting.ModelPositionX),
                                },
                                new SettingsBadgedNumberBox <float>
                                {
                                    Width     = 0.75f,
                                    BadgeText = @"Y",
                                    Bindable  = config.GetBindable <float>(HoloTrackSetting.ModelPositionY),
                                    Anchor    = Anchor.TopRight,
                                    Origin    = Anchor.TopRight,
                                },
                            },
                        },
                    }
                }
            });

            Add(new SettingsCheckbox
            {
                Label    = @"Mouse drag moves the model",
                Bindable = config.GetBindable <bool>(HoloTrackSetting.MouseDrag),
            });

            Add(new SettingsCheckbox
            {
                Label    = @"Mouse wheel scales the model",
                Bindable = config.GetBindable <bool>(HoloTrackSetting.MouseWheel),
            });

            Add(new HoloTrackButton
            {
                Text             = @"Reset",
                BackgroundColor  = Colour4.Red,
                RelativeSizeAxes = Axes.X,
            });
        }