Ejemplo n.º 1
0
 public void RegisterComponent(IUIElement Element)
 {
     if (!componentStates.ContainsKey(Element.GetKey()))
     {
         componentEventStates[Element.GetKey()] = new Dictionary <string, object>()
         {
             { "isMouseInside", false },
             { "scroll", 0 },
         };
         componentStates[Element.GetKey()] = Element.GetDefaultState();
     }
 }
Ejemplo n.º 2
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
                ));
 }