예제 #1
0
        public void GenerateGrid(int textboxNum)
        {
            int row = 0;

            for (int i = 0; i < textboxNum; i++)
            {
                coordBox.Add(new UITextField());
                coordBox[i] = UIUtils.CreateTextFieldCell(gridscroll, m_atlas);
                coordBox[i].isInteractive  = false;
                coordBox[i].normalBgSprite = "OptionsCellDisabled";
                coordBox[i].textColor      = new Color32(255, 255, 255, 255);
                coordBox[i].name           = "Point Text Box " + i;
                coordBox[i].width          = 60f;
                coordBox[i].height         = 25f; //line 2pixels tall
                if (i % 2 == 0)
                {
                    coordBox[i].relativePosition = new Vector2(0, 25 + ((coordBox[i].height - 2) * row));
                }
                else
                {
                    coordBox[i].relativePosition = new Vector2(58, 25 + ((coordBox[i].height - 2) * row));
                    row++;
                }
            }
        }
예제 #2
0
        public override void Start()
        {
            LoadResources();

            atlas            = UIUtils.GetAtlas("Ingame");
            backgroundSprite = "MenuPanel";
            color            = new Color32(255, 255, 255, 255);
            isVisible        = false;
            canFocus         = true;
            isInteractive    = true;
            clipChildren     = true;
            width            = 580;
            height           = INITIAL_HEIGHT;
            absolutePosition = new Vector3(670, 300);

            //make setter!

            // Title Bar
            m_title       = AddUIComponent <UITitleBar>();
            m_title.title = "Notice";
            m_title.GetComponentInChildren <UILabel>().textScale = 1.3f;

            UIPanel panel = AddUIComponent <UIPanel>();

            panel.atlas            = UIUtils.GetAtlas("Ingame");
            panel.backgroundSprite = "GenericPanelDark";
            panel.relativePosition = new Vector2(20, 55);
            panel.size             = new Vector2(width - 40, 300);

            netEle_label                  = panel.AddUIComponent <UILabel>();
            netEle_label.text             = "Display Error";
            netEle_label.autoSize         = false;
            netEle_label.wordWrap         = true;
            netEle_label.width            = 500f;
            netEle_label.height           = 420f;
            netEle_label.relativePosition = new Vector2(20, 20);

            okButton = UIUtils.CreateButton(panel);
            okButton.normalBgSprite   = "GenericPanel";
            okButton.text             = "OK";
            okButton.textScale        = 1f;
            okButton.relativePosition = new Vector2(400, 313);
            okButton.height           = 47;
            okButton.width            = 138;

            okButton.eventClick += (c, p) =>
            {
                if (isVisible)
                {
                    instance.Hide();
                }
            };
        }
예제 #3
0
        public override void Start()
        {
            LoadResources();

            atlas            = UIUtils.GetAtlas("Ingame");
            backgroundSprite = "MenuPanel";
            color            = new Color32(255, 255, 255, 255);
            isVisible        = false;
            canFocus         = true;
            isInteractive    = true;
            clipChildren     = true;
            width            = 180;
            height           = INITIAL_HEIGHT;
            relativePosition = new Vector3(310, 55);

            // Title Bar
            m_title       = AddUIComponent <UITitleBar>();
            m_title.title = "Mesh Points";

            UIPanel panel = AddUIComponent <UIPanel>();

            panel.relativePosition = new Vector2(20, 55);
            panel.size             = new Vector2(145, 530);
            gridscroll             = UIUtils.CreateScrollBox(panel, m_atlas);
            gridscroll.size        = new Vector2(130, 510);

            UILabel titleLabel = gridscroll.AddUIComponent <UILabel>();

            titleLabel.text             = "   Pos    Height";
            titleLabel.tooltip          = "Position from center of mesh | Height from ground level\n(default height for road surface is -0.3m)";
            titleLabel.textAlignment    = UIHorizontalAlignment.Center;
            titleLabel.autoSize         = false;
            titleLabel.width            = 120f;
            titleLabel.height           = 30f;
            titleLabel.relativePosition = new Vector2(0, 0);
            titleLabel.isVisible        = true; //[textboxNum]

            coordBox = new List <UITextField>();
            //GenerateGrid();
            GetMeshPoints();


            //GetMeshPoints();
        }