Exemple #1
0
 public bool PreDraw(float DT, bool AreMouseEventsBlocked, string FocusedElementKey, Vector2?MaybeCursorPosition)
 {
     for (int i = ChildDrawCalls.Length - 1; i >= 0; i--)
     {
         UIDrawCall child = ChildDrawCalls[i];
         AreMouseEventsBlocked = child.PreDraw(
             DT,
             AreMouseEventsBlocked,
             FocusedElementKey,
             ContainsPoint(MaybeCursorPosition) ? MaybeCursorPosition : null
             );
     }
     return(Element.PreDrawBase(
                DT,
                this,
                AreMouseEventsBlocked,
                FocusedElementKey == Element.GetKey(),
                MaybeCursorPosition
                ));
 }
Exemple #2
0
        public void PreDraw(float DT)
        {
            seenElementKeys.Clear();
            if (wasUpdated)
            {
                rootDrawCall = Builder().RenderAsRoot();
                wasUpdated   = false;

                componentStates = componentStates
                                  .Where(entry => seenElementKeys.Contains(entry.Key))
                                  .ToDictionary(entry => entry.Key, entry => entry.Value);
                componentEventStates = componentEventStates
                                       .Where(entry => seenElementKeys.Contains(entry.Key))
                                       .ToDictionary(entry => entry.Key, entry => entry.Value);
            }

            rootDrawCall.PreDraw(
                DT,
                false,
                focusedElementKey,
                GameService.GetService <IInputService>().GetMouseInScreenSpace()
                );
        }