Beispiel #1
0
        public void PostUpdate()
        {
            for (IObject instance = m_instanceHead; instance != null;
                instance = instance.linkInstance) {
            if (instance.IsMovie()) {
                Movie movie = (Movie)instance;
                movie.PostUpdate();
            }
            }

            if (m_attachedMovies != null) {
            foreach (Movie movie in m_attachedMovieList.Values) {
                if (movie != null)
                    movie.PostUpdate();
            }
            }

            if (m_requestedCalculateBounds) {
            m_currentBounds = new Bounds(
                float.MaxValue, float.MinValue, float.MaxValue, float.MinValue);
            Inspect((o, h, d, r) => {CalculateBounds(o);}, 0, 0, 0);
            if (lwf.property.hasMatrix) {
                Matrix invert = new Matrix();
                Utility.InvertMatrix(invert, lwf.property.matrix);
                float x;
                float y;
                Utility.CalcMatrixToPoint(out x, out y,
                    m_currentBounds.xMin, m_currentBounds.yMin, invert);
                m_currentBounds.xMin = x;
                m_currentBounds.yMin = y;
                Utility.CalcMatrixToPoint(out x, out y,
                    m_currentBounds.xMax, m_currentBounds.yMax, invert);
                m_currentBounds.xMax = x;
                m_currentBounds.yMax = y;
                m_bounds = m_currentBounds;
                m_currentBounds = null;
                m_requestedCalculateBounds = false;
                if (m_calculateBoundsCallback != null) {
                    m_calculateBoundsCallback(this);
                    m_calculateBoundsCallback = null;
                }
            }
            }

            if (!m_handler.Empty())
            m_handler.Call(EventType.UPDATE, this);
        }
Beispiel #2
0
 public void RequestCalculateBounds(MovieEventHandler callback = null)
 {
     m_requestedCalculateBounds = true;
     m_calculateBoundsCallback = callback;
     m_bounds = null;
     return;
 }