Пример #1
0
        public override void Setup()
        {
            // MMaterial mt = new MMaterial("nullmat");
            // AddMaterial(mt);
            Panel = MGUI.AddPanel(this, 0, 0, Width, Height, "Panel");
            MMaterial m = new MMaterial("ButtonMat");

            Panel.AddMaterial(m);

            m.AddShader(Helper.GetGUIShader());
            m.SetDiffuseTexture(Globals.TexturePool.GetTexture(IconPath));

            TextItem      = MGUI.AddText(this, 0, 0, Width, Height, "ButtonText", "Hello");
            TextItem.Text = Text;

            base.Setup();
            this.material = null;
        }
Пример #2
0
        public static MText AddText(MControl parent, double x, double y, double w, double h, string sName, string sText)
        {
            MText p = new MText(sName);

            p.transform.Position = new Vector3d(x, y, 0);
            //p.transform.Scale = new Vector3d(w, h, 0);
            p.Width  = w;
            p.Height = h;
            p.Text   = sText;
            if (parent == null)
            {
                _instance.Add(p);
            }
            else
            {
                parent.Add(p);
            }
            return(p);
        }