Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        public Stage()
            : base()
        {
            _inst       = this;
            soundVolume = 1;

            _updateContext = new UpdateContext();
            _soundEnabled  = true;

            _touchInfo         = new TouchInfo();
            _touchInfo.touchId = 0;
            _lastKeyDownTime   = new Dictionary <KeyId, float>();

            _rollOutChain  = new List <DisplayObject>();
            _rollOverChain = new List <DisplayObject>();

            Timers.inst.Add(5, 0, RunTextureCollector);
            GameFramework.RegisterForUpdate(this);
            GameFramework.RegisterForRender(this);

            _focusRemovedDelegate = OnFocusRemoved;

            Renderer.ResolutionChanged += OnResolutionChanged;
            OnResolutionChanged(0, 0);

            _mouseEventListener = new MouseEventListener();
            Global.gEnv.pHardwareMouse.AddListener(_mouseEventListener);

            Input.OnKey += OnKeyEvents;
        }