コード例 #1
0
 public static UIComponent CreateUIComponent(UIComponentFactoryData componentFactoryData, UIComponentGroup parentComponentGroup)
 {
     switch (componentFactoryData.componentEnum)
     {
     //			case UIComponentEnum.BUTTON:
     //			{
     //				IList dataList = componentFactoryData.componentData;
     //				UIAnchorLocation anchorLocation = (UIAnchorLocation)(dataList[0]);
     //				UILayoutType layoutType = (UILayoutType)(dataList[1]);
     //				string text = dataList[6] as string;
     //				if (UILayoutType.RELATIVE_LAYOUT == layoutType)
     //				{
     //					float xStart = (float)(dataList[2]);
     //					float yStart = (float)(dataList[3]);
     //					float xWidth = (float)(dataList[4]);
     //					float yHeight = (float)(dataList[5]);
     //					return new UIButton(xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation, text);
     //				}
     //				else if (UILayoutType.PIXEL_LAYOUT == layoutType)
     //				{
     //					int xStart = (int)(dataList[2]);
     //					int yStart = (int)(dataList[3]);
     //					int xWidth = (int)(dataList[4]);
     //					int yHeight = (int)(dataList[5]);
     //					return new UIButton(xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation, text);
     //				}
     //				return null;
     //			}
     default:
         return null;
     }
 }
コード例 #2
0
ファイル: UI.cs プロジェクト: JELGT2011/A_Spire_to_Defend
        public UI(UIComponentGroup headGroup)
        {
            m_menuDictionary = new HybridDictionary(4, true);
            m_menuStack = new UIMenuStack();

            UIMenu menu = new UIMenu(headGroup);

            m_menuDictionary.Add(1, menu);
        }
コード例 #3
0
        public UIRelativeLayout(float xStart,
		                        float yStart,
		                        float xWidth,
		                        float yHeight,
		                        UIComponentGroup parentComponentGroup,
		                        UIAnchorLocation anchorLocation)
            : this("", xStart, yStart, xWidth, yHeight, parentComponentGroup, anchorLocation)
        {
            SetName(Id.ToString());
        }
コード例 #4
0
        public UIRelativeLayout(string componentName,
		                        float xStart,
		                        float yStart,
		                        float xWidth,
		                        float yHeight,
		                        UIComponentGroup parentComponentGroup,
		                        UIAnchorLocation anchorLocation)
            : base(componentName, xStart, yStart, xWidth, yHeight, parentComponentGroup, UILayoutType.RELATIVE_LAYOUT, anchorLocation)
        {
            m_componentType = UIComponentType.LAYOUT;
        }
コード例 #5
0
        public UIGridLayout(float xStart,
		                    float yStart,
		                    float xWidth,
		                    float yHeight,
		                    UIComponentGroup parentComponentGroup,
		                    UIAnchorLocation anchorLocation,
		                    int xGridSections,
		                    int yGridSections)
            : this("", xStart, yStart, xWidth, yHeight, parentComponentGroup, anchorLocation, xGridSections, yGridSections)
        {
            SetName(Id.ToString());
        }
コード例 #6
0
        public UIStaticButton(float xStart,
		                      float yStart,
		                      float xWidth,
		                      float yHeight,
		                      UIComponentGroup parentComponentGroup,
		                      UILayoutType layoutType,
		                      UIAnchorLocation anchorLocation,
		                      IUIButtonListener buttonListener)
            : this("", xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation, buttonListener)
        {
            SetName(Id.ToString());
        }
コード例 #7
0
        public UIRenderable(string componentName,
		                    float xStart,
		                    float yStart,
		                    float xWidth,
		                    float yHeight,
		                    UIComponentGroup parentComponentGroup,
		                    UILayoutType layoutType,
		                    UIAnchorLocation anchorLocation)
            : base(componentName, xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation)
        {
            m_componentType = UIComponentType.RENDERABLE;
        }
コード例 #8
0
        public UITextureLabel(float xStart,
		                      float yStart,
		                      float xWidth,
		                      float yHeight,
		                      UIComponentGroup parentComponentGroup,
		                      UILayoutType layoutType,
		                      UIAnchorLocation anchorLocation,
		                      Texture2D texture2D)
            : this("", xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation, texture2D)
        {
            SetName(Id.ToString());
        }
コード例 #9
0
        public UIStaticButton(string componentName,
		                      float xStart,
		                      float yStart,
		                      float xWidth,
		                      float yHeight,
		                      UIComponentGroup parentComponentGroup,
		                      UILayoutType layoutType,
		                      UIAnchorLocation anchorLocation,
		                      IUIButtonListener buttonListener)
            : base(componentName, xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation, buttonListener)
        {
            m_hitBox = new UIButtonHitBox(xStart, yStart, xWidth, yHeight, this, layoutType, anchorLocation);
        }
コード例 #10
0
        public UITextureLabel(string componentName,
		                      float xStart,
		                      float yStart,
		                      float xWidth,
		                      float yHeight,
		                      UIComponentGroup parentComponentGroup,
		                      UILayoutType layoutType,
		                      UIAnchorLocation anchorLocation,
		                      Texture2D texture2D)
            : base(componentName, xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation)
        {
            m_texture2D = texture2D;
            m_guiStyle = new GUIStyle();
        }
コード例 #11
0
        protected UIComponentGroup(string componentName,
		                           float xStart,
		                           float yStart,
		                           float xWidth,
		                           float yHeight,
		                           UIComponentGroup parentComponentGroup,
		                           UILayoutType layoutType,
		                           UIAnchorLocation anchorLocation)
            : base(componentName, xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation)
        {
            m_componentIdDictionary = new HybridDictionary();
            m_componentNameDictionary = new HybridDictionary();
            m_listComponent = new LinkedList<UIComponent>();
        }
コード例 #12
0
        public UIStringLabel(string componentName,
		                     float xStart,
		                     float yStart,
		                     float xWidth,
		                     float yHeight,
		                     UIComponentGroup parentComponentGroup,
		                     UILayoutType layoutType,
		                     UIAnchorLocation anchorLocation,
		                     UITextInfo textInfo,
		                     string text)
            : base(componentName, xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation)
        {
            m_guiStyle = textInfo.GetGUIStyle();
            m_textInfo = textInfo;
            m_text = text;
        }
コード例 #13
0
        public UIGridLayout(string componentName,
		                    float xStart,
		                    float yStart,
		                    float xWidth,
		                    float yHeight,
		                    UIComponentGroup parentComponentGroup,
		                    UIAnchorLocation anchorLocation,
		                    int xGridSections,
		                    int yGridSections)
            : base(componentName, xStart, yStart, xWidth, yHeight, parentComponentGroup, anchorLocation)
        {
            m_xGridSections = xGridSections;
            m_yGridSections = yGridSections;

            m_grid = new ArrayList(xGridSections * yGridSections);
        }
コード例 #14
0
        protected UIComponent(string componentName,
		                      float xStart,
		                      float yStart,
		                      float xWidth,
		                      float yHeight,
		                      UIComponentGroup parentComponentGroup,
		                      UILayoutType layoutType,
		                      UIAnchorLocation anchorLocation)
        {
            m_componentId = UI.GenerateId();
            m_componentName = componentName;

            m_anchor = new UIAnchor(anchorLocation, xStart, yStart, xWidth, yHeight);
            m_layoutType = layoutType;
            m_parentComponentGroup = parentComponentGroup;
        }
コード例 #15
0
        public UIButton(string componentName,
		                float xStart,
		                float yStart,
		                float xWidth,
		                float yHeight,
		                UIComponentGroup parentComponentGroup,
		                UILayoutType layoutType,
		                UIAnchorLocation anchorLocation,
		                IUIButtonListener buttonListener)
            : base(componentName, xStart, yStart, xWidth, yHeight, parentComponentGroup, layoutType, anchorLocation)
        {
            m_componentType = UIComponentType.BUTTON;
            if (null == buttonListener)
                m_buttonListener = new UIButtonListenerDoNothing();
            else
                m_buttonListener = buttonListener;
        }
コード例 #16
0
        public UIComponentGroupIterator(UIComponentGroup headComponentGroup)
        {
            m_componentIdDictionary = new HybridDictionary();
            m_componentNameDictionary = new HybridDictionary();
            m_componentArrayList = new ArrayList();

            m_headComponentGroup = headComponentGroup;

            m_renderableArrayList = new ArrayList();
            //			m_layoutArrayList = new ArrayList();
            m_buttonArrayList = new ArrayList();

            PopulateComponentArrayList();

            PopulateRenderableArrayList();
            PopulateButtonArrayList();

            CalculateRenderingOutput();
        }
コード例 #17
0
 public void SetParentComponentGroup(UIComponentGroup newParent)
 {
     m_parentComponentGroup = newParent;
 }
コード例 #18
0
ファイル: UIMenu.cs プロジェクト: JELGT2011/A_Spire_to_Defend
 public UIMenu(UIComponentGroup headGroup)
 {
     m_componentGroupIterator = new UIComponentGroupIterator(headGroup);
 }