/// <summary> /// Draw the scene. /// This method is called every frame. Don't call it manually. /// </summary> protected void DrawScene(GameTime gameTime) { if (m_NeedsInit) { return; } float startTime = 0; if (m_bDisplayStats) { startTime = (float)m_pStopwatch.Elapsed.TotalMilliseconds; } CCDrawManager.PushMatrix(); // draw the scene if (m_pRunningScene != null) { m_pRunningScene.Visit(); } // draw the notifications node if (m_pNotificationNode != null) { NotificationNode.Visit(); } ShowStats(); CCDrawManager.PopMatrix(); m_uTotalFrames++; if (m_bDisplayStats) { m_uDrawCount++; m_fAccumDraw += (float)m_pStopwatch.Elapsed.TotalMilliseconds - startTime; } }
protected void Draw(CCGameTime gameTime) { Stats.UpdateStart(); DrawManager.PushMatrix(); foreach (CCDirector director in sceneDirectors) { CCScene runningScene = director.RunningScene; // draw the scene if (runningScene != null) { runningScene.Visit(); if (EventDispatcher.IsEventListenersFor(EVENT_AFTER_VISIT)) { EventDispatcher.DispatchEvent(eventAfterVisit); } } // draw the notifications node if (NotificationNode != null) { NotificationNode.Visit(); } if (EventDispatcher.IsEventListenersFor(EVENT_AFTER_DRAW)) { EventDispatcher.DispatchEvent(eventAfterDraw); } } DrawManager.PopMatrix(); Stats.Draw(this); }
public void AddNotificationText(NodeAddedEvent e, NotificationNode notification) { notification.Entity.AddComponent(new NotificationMessageComponent(string.Empty)); }
public void CreateUserRankRewardNotification(NodeAddedEvent e, NotificationNode notification) { notification.Entity.AddComponent(new NotificationMessageComponent(string.Empty)); }
public void PrepareNotificationText(NodeAddedEvent e, NotificationNode notification, [JoinAll] ChangeUIDSystem.SelfUserNode user) { string message = string.Format(notification.uIDChangedNotificationText.MessageTemplate, user.userUid.Uid); notification.Entity.AddComponent(new NotificationMessageComponent(message)); }
public void PrepareNotificationText(NodeAddedEvent e, NotificationNode notification, [Context, JoinByUser] SingleNode <UserUidComponent> fromUser, NotificationNode notificationToMap, [Context, JoinByMap] MapNode map) { string message = string.Format(notification.inviteFriendToBattleNotification.MessageTemplate, fromUser.component.Uid, map.descriptionItem.Name, notification.battleMode.BattleMode); notification.Entity.AddComponent(new NotificationMessageComponent(message)); }
public void GoToBattle(NotificationClickEvent e, NotificationNode notification, [JoinAll] Optional <SingleNode <SelfBattleUserComponent> > userInBattle) { base.ScheduleEvent(new ShowBattleEvent(notification.battleGroup.Key), EngineService.EntityStub); }