Esempio n. 1
0
		public static AGSSayConfig FromConfig(ISayConfig config, float paddingBottomOffset = 0f)
		{
			AGSSayConfig sayConfig = new AGSSayConfig();
			sayConfig.TextConfig = AGSTextConfig.FromConfig (config.TextConfig, paddingBottomOffset);
			sayConfig.TextDelay = config.TextDelay;
			sayConfig.SkipText = config.SkipText;
			sayConfig.LabelSize = config.LabelSize;
			sayConfig.Border = config.Border;
			sayConfig.BackgroundColor = config.BackgroundColor;
            sayConfig.PortraitConfig = config.PortraitConfig;
			return sayConfig;
		}
Esempio n. 2
0
        private static ISayConfig getDefaultConfig()
        {
            AGSSayConfig config = new AGSSayConfig();

            config.Border = AGSBorders.Gradient(AGSGame.Resolver.Container.Resolve <IGLUtils>(), new FourCorners <Color>(Colors.DarkOliveGreen,
                                                                                                                         Colors.LightGreen, Colors.LightGreen, Colors.DarkOliveGreen), 3f, true);
            config.TextConfig = new AGSTextConfig(autoFit: AutoFit.TextShouldWrapAndLabelShouldFitHeight
                                                  , paddingLeft: 8, paddingTop: 8, paddingBottom: 8, paddingRight: 8);
            config.LabelSize = new SizeF(AGSGame.Game.Settings.VirtualResolution.Width * 3 / 4f,
                                         AGSGame.Game.Settings.VirtualResolution.Height * 3 / 4f);
            config.BackgroundColor = Colors.Black;
            return(config);
        }
Esempio n. 3
0
        public static AGSSayConfig FromConfig(ISayConfig config, float paddingBottomOffset = 0f)
        {
            AGSSayConfig sayConfig = new AGSSayConfig();

            sayConfig.TextConfig      = AGSTextConfig.FromConfig(config.TextConfig, paddingBottomOffset);
            sayConfig.TextDelay       = config.TextDelay;
            sayConfig.SkipText        = config.SkipText;
            sayConfig.LabelSize       = config.LabelSize;
            sayConfig.Border          = config.Border;
            sayConfig.BackgroundColor = config.BackgroundColor;
            sayConfig.PortraitConfig  = config.PortraitConfig;
            return(sayConfig);
        }
Esempio n. 4
0
        private static ISayConfig getDefaultConfig()
        {
            AGSSayConfig config = new AGSSayConfig();

            config.Border = AGSBorders.Gradient(AGSGame.Resolver.Container.Resolve <IGLUtils>(), new FourCorners <Color>(Colors.DarkOliveGreen,
                                                                                                                         Colors.LightGreen, Colors.LightGreen, Colors.DarkOliveGreen), 3f, true);
            config.TextConfig = new AGSTextConfig(autoFit: AutoFit.TextShouldWrapAndLabelShouldFitHeight, alignment: Alignment.TopCenter
                                                  , paddingLeft: 30, paddingTop: 30, paddingBottom: 30, paddingRight: 30);
            var screenWidth  = AGSGame.Game.Settings.VirtualResolution.Width;
            var screenHeight = AGSGame.Game.Settings.VirtualResolution.Height;

            if (RenderLayer.IndependentResolution != null)
            {
                screenWidth  = RenderLayer.IndependentResolution.Value.Width;
                screenHeight = RenderLayer.IndependentResolution.Value.Height;
            }
            config.LabelSize       = new SizeF(screenWidth * 3 / 4f, screenHeight * 3 / 4f);
            config.BackgroundColor = Colors.Black;
            return(config);
        }
Esempio n. 5
0
        private ISayConfig getDefaultConfig(IGame game)
        {
            AGSSayConfig config = new AGSSayConfig(game);

            config.Border = game.Factory.Graphics.Borders.Gradient(new FourCorners <Color>(Colors.DarkOliveGreen,
                                                                                           Colors.LightGreen, Colors.LightGreen, Colors.DarkOliveGreen), 3f, true);
            config.TextConfig = game.Factory.Fonts.GetTextConfig(autoFit: AutoFit.TextShouldWrapAndLabelShouldFitHeight, alignment: Alignment.TopCenter
                                                                 , paddingLeft: 30, paddingTop: 30, paddingBottom: 30, paddingRight: 30);
            var screenWidth  = game.Settings.VirtualResolution.Width;
            var screenHeight = game.Settings.VirtualResolution.Height;

            if (RenderLayer.IndependentResolution != null)
            {
                screenWidth  = RenderLayer.IndependentResolution.Value.Width;
                screenHeight = RenderLayer.IndependentResolution.Value.Height;
            }
            config.LabelSize       = new SizeF(screenWidth * 3 / 4f, screenHeight * 3 / 4f);
            config.BackgroundColor = Colors.Black;
            return(config);
        }
Esempio n. 6
0
        private static ISayComponent getSayComponent(float buttonHeight)
        {
            TypedParameter       outfitParameter        = new TypedParameter(typeof(IOutfitComponent), null);
            ISayLocationProvider location               = new MessageBoxLocation(AGSGame.Game);
            TypedParameter       locationParameter      = new TypedParameter(typeof(ISayLocationProvider), location);
            TypedParameter       faceDirectionParameter = new TypedParameter(typeof(IFaceDirectionComponent), null);
            TypedParameter       configParameter        = new TypedParameter(typeof(ISayConfig), AGSSayConfig.FromConfig(Config, buttonHeight));

            return(AGSGame.Resolver.Container.Resolve <ISayComponent>(locationParameter, outfitParameter,
                                                                      faceDirectionParameter, configParameter));
        }
Esempio n. 7
0
		private static ISayConfig getDefaultConfig()
		{
			AGSSayConfig config = new AGSSayConfig ();
			config.Border =  AGSBorders.Gradient(AGSGame.Resolver.Container.Resolve<IGLUtils>(), new FourCorners<Color>(Colors.DarkOliveGreen,
				Colors.LightGreen, Colors.LightGreen, Colors.DarkOliveGreen), 3f, true);
			config.TextConfig = new AGSTextConfig (autoFit: AutoFit.TextShouldWrapAndLabelShouldFitHeight
				, paddingLeft: 8, paddingTop: 8, paddingBottom: 8, paddingRight: 8);
			config.LabelSize = new SizeF (AGSGame.Game.Settings.VirtualResolution.Width*3/4f, 
				AGSGame.Game.Settings.VirtualResolution.Height*3/4f);
			config.BackgroundColor = Colors.Black;
			return config;
		}
Esempio n. 8
0
        private static ISayComponent getSayComponent(float buttonHeight, IGame game, IMessageBoxSettings settings)
        {
            TypedParameter       outfitParameter        = new TypedParameter(typeof(IOutfitComponent), null);
            ISayLocationProvider location               = new MessageBoxLocation(game, settings);
            TypedParameter       locationParameter      = new TypedParameter(typeof(ISayLocationProvider), location);
            TypedParameter       faceDirectionParameter = new TypedParameter(typeof(IFaceDirectionComponent), null);
            TypedParameter       configParameter        = new TypedParameter(typeof(ISayConfig), AGSSayConfig.FromConfig(settings.DisplayConfig, buttonHeight));
            var resolver = (Resolver)game.Resolver;

            return(resolver.Resolve <ISayComponent>(locationParameter, outfitParameter,
                                                    faceDirectionParameter, configParameter));
        }