コード例 #1
0
    public MainHub(MainGame tempGame) : base("Sprites/MainHub.png", 32, 24, "Sprites/MainHub.png", 32, 24, "colors.png", 1, 1, tempGame)
    {
        FileName = @"Screens/MainHub/MainHub.tmx";

        Map _levelData = MapParser.ReadMap(FileName);

        SpawnCollisionTiles(_levelData);
        SpawnBackgroundTiles(_levelData, true);
        SpawnObjects(_levelData);
        SpawnOverlapTiles(_levelData);

        _game       = tempGame;
        _displayTut = _game.DisplayTutorial;

        _tickets = new TicketDisplay(_game);
        AddChild(_tickets);

        _clock = new Clock();
        AddChild(_clock);

        if (_displayTut)
        {
            _c = new ConversationBox("Text/Tutorial.txt", this);
            AddChild(_c);
        }

        FirstInstance = false;

        _shopKeeper = new ShopKeeper();
        AddChild(_shopKeeper);
    }
コード例 #2
0
ファイル: Main.cs プロジェクト: Abd-Barakat/ChatApplication
 /// <summary>
 /// Write string to conversationBox textbox, this method can be used by different threads to write on conversationBox textbox
 /// </summary>
 /// <param name="Msg">
 /// string to write in conversationBox textbox
 /// </param>
 private void SetText(string Msg)
 {
     if (this.ConversationBox.InvokeRequired)//check if caller Id is different from creator id
     {
         SetTextCallBack setText = new SetTextCallBack(SetText);
         Invoke(setText, Msg);//call delegate from creator thread
     }
     else//if method called from creator thread
     {
         ConversationBox.AppendText(Msg + "\r\n");
     }
 }
コード例 #3
0
 public void DeleteTut()
 {
     _game.DisplayTutorial = false;
     _c.LateDestroy();
     _c = null;
 }