Ejemplo n.º 1
0
        public override void Start()
        {
            _margin = 15;

            _background     = GraphicsHelper.CreateGradiantTexture(Color.LightSteelBlue, Color.Linen, Screen.VirtualWidth, Screen.VirtualHeight);
            _backgroundRect = new Rectangle(0, 0, Screen.VirtualWidth, Screen.VirtualHeight);

            var tempVec2 = GUI.Skin.Font.MeasureString("C3DE Demos");

            _titleSize = 2.5f;
            _titleRect = new Vector2(Screen.VirtualWidthPerTwo - tempVec2.X * _titleSize / 2, tempVec2.Y + 5);

            tempVec2    = GUI.Skin.Font.MeasureString("Gets the source : https://github.com/demonixis/C3DE");
            _footerRect = new Vector2(Screen.VirtualWidthPerTwo - tempVec2.X / 2, Screen.VirtualHeight - tempVec2.Y - 5);

            _demos = new DemoWidget[Application.SceneManager.Count - 1];

            for (int i = 0; i < _demos.Length; i++)
            {
                _demos[i] = new DemoWidget(Application.SceneManager[i + 1].Name, i + 1);
            }

            float x = Screen.VirtualWidthPerTwo - ButtonWidth / 2;
            float y = Screen.VirtualHeightPerTwo - ((ButtonHeight + _margin) * _demos.Length) / 2;

            for (int i = 0; i < _demos.Length; i++)
            {
                _demos[i].SetPosition(x, y + i * (ButtonHeight + _margin));
            }
        }
Ejemplo n.º 2
0
    void Demo()
    {
        DemoWidget demoWidget = FindCurrentModuleWidget("GetButton#") as DemoWidget;

        //demoWidget.AddButtonOnClickListener()
    }