Пример #1
0
        public void Initialize(TojamGame game)
        {
            // get dimensions to size thingsa round
            renderTarget = new RenderTarget2D(game.GraphicsDevice, chatSceneDimensions.Width, chatSceneDimensions.Height);
            Rectangle screenBounds       = chatSceneDimensions;
            int       messageBufferWidth = 200;

            // build chatlog
            ChatLogStyle style = new ChatLogStyle();

            style.font            = game.GameFont;
            style.linePadding     = 1;
            style.messagePadding  = 5;
            style.externalPadding = 10;
            style.internalBounds  = new Rectangle(
                screenBounds.Width - messageBufferWidth + style.externalPadding,
                style.externalPadding,
                messageBufferWidth - style.externalPadding * 2,
                screenBounds.Height - style.externalPadding
                );
            style.backgroundColor = Color.Black;

            chatLog = new ChatLog(style);
            chatLog.Initialize(game);
            chatLog.AppendMessage("Welcome to Algonquin Park Roadtrip Simulator 2018!", Color.White);
            chatLog.AppendMessage("Your goal is to reach Algonquin Park and have happy camping trip", Color.Gray);
            chatLog.AppendMessage("Type `help` to see commands", Color.Gray);
//			chatLog.AppendMessage("Type 'join <ip>' to join a game, or 'host' to start a new one", Color.Gray);
            chatLog.AppendMessage("Type 'setname <name>' set your name before starting a game", Color.Gray);

            // build textbox
            textBox = new TextBox(
                game.GameFont,
                new Rectangle(
                    0,
                    screenBounds.Height - game.GameFont.LineSpacing,
                    screenBounds.Width - messageBufferWidth,
                    game.GameFont.LineSpacing
                    ));

            // initialize displayable scene
            carPicture = new CarPicture(new Rectangle(0, 0, screenBounds.Width - messageBufferWidth, screenBounds.Height - game.GameFont.LineSpacing * 2 - 5));
            carPicture.Initialize(game);
            carPicture.SetSky(CarPicture.Sky.Day);
            carPicture.SetBackground(CarPicture.Background.Title);
            //carPicture.TriggerEvent("town", new Dictionary<String, Object> { { "townName", "Algonquin" } });

            playerStatusIndicator = new PlayerStatusIndicator(game.GameFont, new Vector2(0, screenBounds.Height - game.GameFont.LineSpacing * 2));
        }
Пример #2
0
 public void LoadContent(TojamGame game)
 {
     Debug.WriteLine("Chat : Load Content");
     CarPicture.LoadContent(game);
 }