Esempio n. 1
0
        public static MPanel AddPanel(MControl parent, double x, double y, double w, double h, string sName)
        {
            MPanel p = new MPanel(sName);

            p.transform.Position = new Vector3d(x, y, 0);
            //p.transform.Scale = new Vector3d(w, h, 0);
            p.Width  = w;
            p.Height = h;
            if (parent == null)
            {
                _instance.Add(p);
            }
            else
            {
                parent.Add(p);
            }
            return(p);
        }
Esempio n. 2
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;
        }