Exemple #1
0
        public Movie AttachMovie(string linkageName, string attachName,
                                 int attachDepth          = -1, bool reorder = false,
                                 MovieEventHandler load   = null, MovieEventHandler postLoad   = null,
                                 MovieEventHandler unload = null, MovieEventHandler enterFrame = null,
                                 MovieEventHandler update = null, MovieEventHandler render     = null)
        {
            int movieId = m_lwf.SearchMovieLinkage(m_lwf.GetStringId(linkageName));

            if (movieId == -1)
            {
                return(null);
            }

            MovieEventHandlers handlers = new MovieEventHandlers();

            handlers.Add(load, postLoad, unload, enterFrame, update, render);
            Movie movie = new Movie(m_lwf, this, movieId, -1, 0, 0, true, handlers);

            if (m_attachMovieExeced)
            {
                movie.Exec();
            }
            if (m_attachMoviePostExeced)
            {
                movie.PostExec(true);
            }

            return(AttachMovieInternal(movie, attachName, attachDepth, reorder));
        }
Exemple #2
0
        public Movie AttachMovie(string linkageName, string attachName,
		int attachDepth = -1, bool reorder = false,
		MovieEventHandler load = null, MovieEventHandler postLoad = null,
		MovieEventHandler unload = null, MovieEventHandler enterFrame = null,
		MovieEventHandler update = null, MovieEventHandler render = null)
        {
            int movieId = m_lwf.SearchMovieLinkage(m_lwf.GetStringId(linkageName));
            if (movieId == -1)
            return null;

            MovieEventHandlers handlers = new MovieEventHandlers();
            handlers.Add(load, postLoad, unload, enterFrame, update, render);
            Movie movie = new Movie(m_lwf, this, movieId, -1, 0, 0, true, handlers);
            if (m_attachMovieExeced)
            movie.Exec();
            if (m_attachMoviePostExeced)
            movie.PostExec(true);

            return AttachMovieInternal(movie, attachName, attachDepth, reorder);
        }
Exemple #3
0
        public int Exec(float tick    = 0,
                        Matrix matrix = null, ColorTransform colorTransform = null)
        {
            bool  execed          = false;
            float currentProgress = m_progress;

            if (m_execDisabled && tweens == null)
            {
                if (!m_executedForExecDisabled)
                {
                    ++m_execCount;
                    m_rootMovie.Exec();
                    m_rootMovie.PostExec(true);
                    m_executedForExecDisabled = true;
                    execed = true;
                }
            }
            else
            {
                bool progressing = true;
                m_thisTick = tick;
                if (tick == 0)
                {
                    m_progress = m_tick;
                }
                else if (tick < 0)
                {
                    m_progress  = m_tick;
                    progressing = false;
                }
                else
                {
                    if (m_time == 0)
                    {
                        m_time     += (double)m_tick;
                        m_progress += m_tick;
                    }
                    else
                    {
                        m_time     += (double)tick;
                        m_progress += tick;
                    }
                }

                if (m_execHandlers != null)
                {
                    m_execHandlers.ForEach(h => h(this));
                }

                int execLimit = m_execLimit;
                while (m_progress >= m_tick - m_roundOffTick)
                {
                    if (--execLimit < 0)
                    {
                        m_progress = 0;
                        break;
                    }
                    m_progress -= m_tick;
                    ++m_execCount;
                    m_rootMovie.Exec();
                    m_rootMovie.PostExec(progressing);
                    execed = true;
                }

                if (m_progress < m_roundOffTick)
                {
                    m_progress = 0;
                }

                m_buttonHead = null;
                if (interactive && m_rootMovie.hasButton)
                {
                    m_rootMovie.LinkButton();
                }
            }

            if (execed || isLWFAttached ||
                isPropertyDirty || matrix != null || colorTransform != null)
            {
                Update(matrix, colorTransform);
            }

            if (!m_execDisabled)
            {
                if (tick < 0)
                {
                    m_progress = currentProgress;
                }
            }

            return(m_renderingCount);
        }
Exemple #4
0
        public int ExecInternal(float tick)
        {
            if (m_rootMovie == null)
            {
                return(0);
            }
            bool  execed          = false;
            float currentProgress = m_progress;

            if (m_execDisabled && tweens == null)
            {
                if (!m_executedForExecDisabled)
                {
                    ++m_execCount;
                    m_rootMovie.Exec();
                    m_rootMovie.PostExec(true);
                    m_executedForExecDisabled = true;
                    execed = true;
                }
            }
            else
            {
                bool progressing = true;
                if (tick == 0)
                {
                    m_progress = m_tick;
                }
                else if (tick < 0)
                {
                    m_progress  = m_tick;
                    progressing = false;
                }
                else
                {
                    if (m_time == 0)
                    {
                        m_time     += (double)m_tick;
                        m_progress += m_tick;
                    }
                    else
                    {
                        m_time     += (double)tick;
                        m_progress += tick;
                    }
                }

                if (m_execHandlers != null)
                {
                    foreach (var h in m_execHandlers)
                    {
                        h(this);
                    }
                }

                int execLimit = m_execLimit;
                while (m_progress >= m_tick - m_roundOffTick)
                {
                    if (--execLimit < 0)
                    {
                        m_progress = 0;
                        break;
                    }
                    m_progress -= m_tick;
                    ++m_execCount;
                    m_rootMovie.Exec();
                    m_rootMovie.PostExec(progressing);
                    execed = true;
                    if (!m_frameSkip)
                    {
                        break;
                    }
                }

                if (m_progress < m_roundOffTick)
                {
                    m_progress = 0;
                }

                LinkButton();
            }

            if (isLWFAttached)
            {
                bool hasButton = m_rootMovie.ExecAttachedLWF(tick, currentProgress);
                if (hasButton)
                {
                    LinkButton();
                }
            }

            m_needsUpdate = false;
            if (!m_fastForward)
            {
                if (execed || m_propertyDirty || m_needsUpdateForAttachLWF)
                {
                    m_needsUpdate = true;
                }
            }

            if (!m_execDisabled)
            {
                if (tick < 0)
                {
                    m_progress = currentProgress;
                }
            }

            return(m_renderingCount);
        }