Example #1
0
        protected void CreateMethodClip(MethodComponent method, int maxLength,
                                        int x, int y, int w, int h)
        {
            MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h);

            clip.Object = method;
            // Back rectangle
            clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h);

            double length      = method.Lines.Count;
            double smell_width = w * (length / maxLength);

            // Smell rectangle
            clip.Graphics.FillRectangle(m_smellBrush, 0, 0, (int)smell_width, h);

            // Iteration/Conditional/Comment markings
            int lineCount = 0;

            foreach (LineModel model in method.Lines)
            {
                Pen pen = GetPen(model);
                // Hack
                if (pen != null)
                {
                    double ratio  = lineCount / length;
                    int    mark_x = (int)(ratio * smell_width);
                    clip.Graphics.DrawLine(pen, mark_x, 0, mark_x, h);
                }
                lineCount++;
            }
            clip.CenteredString(method.Name + "() " + method.Lines.Count);
        }
		protected void CreateClassHier( MovieClip parent, string pre, string[] baseCls,
			int x, int y, int w, int h )
		{
			MovieClip clip = parent.CreateSubMovieClip( x, y, w, h );
			//clip.Object = chain;
			// Back rectangle
			clip.Graphics.FillRectangle( m_backBrush, 0, 0, w, h);

			// Parent Class
			MovieClip par = clip.CreateSubMovieClip( 0, 0, w, h/2 );

			MovieClip dot = par.CreateSubMovieClip( w/2, h/4, 10, 10 );
			dot.Graphics.FillEllipse( Brushes.White, 0, 0, 9, 9 );
			par.LeftString( pre, Brushes.White );

			// Children
			MovieClip dots = clip.CreateSubMovieClip( 0, h/2, w, h/2 );
			//dots.Graphics.FillRectangle( Brushes.Wheat, 0, 0, w/4, h );

			int centerHack = 29;
			Brush[] brushes = new Brush[]{Brushes.LightGreen,Brushes.LightBlue, Brushes.LightPink};
			for( int d = 0; d < baseCls.Length; d++ )
			{   // extra spacing in between disconnected chains?
				MovieClip dd = dots.CreateSubMovieClip( 0, 0, 10, 10 );
				dd.Graphics.FillEllipse( brushes[d], 0, 0, 9, 9 );

				clip.Graphics.DrawLine( Pens.White, w/2+4, h/4+3, (centerHack-2) + ((1+d)*10), h/2 + 5 );
			}
			Space( centerHack, 3, 3, 3, dots.Children, dots.Width );

			
			// Text
			//MovieClip text = clip.CreateSubMovieClip( dots.Width, 0, w - dots.Width, h );
			//text.LeftString( "(" + chain.Count +")  " + chain.MessageChain, Brushes.White);
		}
Example #3
0
        protected void CreateMethodClip(MessageChainComponent chain,
                                        int x, int y, int w, int h)
        {
            MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h);

            clip.Object = chain;
            // Back rectangle
            clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h);

            // Dots
            MovieClip dots = clip.CreateSubMovieClip(0, 0, w / 4, h);

            //dots.Graphics.FillRectangle( Brushes.Wheat, 0, 0, w/4, h );
            for (int d = 0; d < chain.Length; d++)
            {               // extra spacing in between disconnected chains?
                MovieClip dot = dots.CreateSubMovieClip(0, 0, 10, 10);
                dot.Graphics.FillEllipse(Brushes.LightGreen, 0, 0, 9, 9);
            }
            Space(3, 3, dots.Children, dots.Width);

            // Text
            MovieClip text = clip.CreateSubMovieClip(dots.Width, 0, w - dots.Width, h);

            text.LeftString("(" + chain.Count + ")  " + chain.MessageChain, Brushes.White);
        }
        protected void CreateMethodClip(TemporaryFieldComponent temp,
                                        int x, int y, int w, int h)
        {
            MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h);

            clip.Object = temp.ClassComponent;
            // Back rectangle
            clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h);

            // Dots
            MovieClip dots = clip.CreateSubMovieClip(0, 0, w, h / 2);

            dots.Object = temp.ClassComponent;
            for (int d = 0; d < temp.Uses.Count; d++)
            {               // extra spacing in between disconnected chains?
                MovieClip dot = dots.CreateSubMovieClip(0, 0, 10, 10);
                dot.Graphics.FillEllipse(Brushes.Yellow, 0, 0, 9, 9);
            }
            Space(3, 3, dots.Children, dots.Width);

            // Dots 2
            MovieClip dots2 = clip.CreateSubMovieClip(0, h / 2, w, h / 2);

            dots2.Object = temp.ClassComponent;
            for (int d = 0; d < temp.Defs.Count; d++)
            {               // extra spacing in between disconnected chains?
                MovieClip dot = dots2.CreateSubMovieClip(0, 0, 10, 10);
                dot.Graphics.FillEllipse(Brushes.LightBlue, 0, 0, 9, 9);
                //Brushes.LemonChiffon
            }
            Space(3, 3, dots2.Children, dots2.Width);

            // Text
            clip.CenteredString(temp.Name);
        }
Example #5
0
	void Start () {
		
		// Validate MovieClipOverlayCameraBehaivour is attached to camera
		if( MovieClipOverlayCameraBehaviour.instance == null ) {
			Debug.LogError( "Failed to get MovieClipOverlayCameraBehaviour, ensure its attached to the MainCamera" );
			return;
		}
		
		// Assign stage reference
		stage = MovieClipOverlayCameraBehaviour.instance.stage;
		
		// Create menu clip
		MovieClip btn = new MovieClip( "uniSWF/Examples/Tutorial 02 - Basic button script/swf/Tut02-ButtonAsset.swf:btn_ui" );

		// Center on stage for the current screen size
		btn.x = (stage.stageWidth / 2) - (btn.srcWidth/2);  
		btn.y = (stage.stageHeight / 2) - (btn.srcHeight/2);

		// Jump to first frame and stop
		btn.gotoAndStop(1);	 

		// Inner display object such as text fields will not recieve events
		btn.mouseChildrenEnabled = false;  
		
		// Event listeners
		btn.addEventListener( MouseEvent.CLICK, onButtonClick);
		btn.addEventListener( MouseEvent.MOUSE_ENTER, onButtonEnter);
		btn.addEventListener( MouseEvent.MOUSE_LEAVE, onButtonLeave);
		
		// Add menu clip to stage
		stage.addChild(btn);
	}
        protected void RefusedBequest(int x, int y, int w, int h)
        {
            MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h);

            //clip.Object = chain;
            // Back rectangle
            clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h);
            // Dots

            Pen p = new Pen(Brushes.LightBlue, 3);
            Pen b = new Pen(Brushes.LightCoral, 3);
            int l = 10;

            for (int d = 0; d < 18; d++)
            {
                MovieClip dot = clip.CreateSubMovieClip(0, 0, l, 6);

                if (d % 4 == 0)
                {
                    dot.Graphics.DrawLine(p, 0, 0, l - 1, 0);
                }
                else
                {
                    dot.Graphics.DrawLine(b, 0, 0, l - 1, 0);
                }
            }

            Space(10, 18, 10, 2, clip.Children, w);
            clip.LeftString("StorageDB", Brushes.White);
        }
Example #7
0
        public void OnFail()
        {
            m_isInQTE = false;
            MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
            MovieClip       movieClip       = motionDelegator.AddMovieClip();

            movieClip.AppendMotion(Mgr <GameEngine> .Singleton.TimeScaleRef, new CatFloat(1.0f), 500);
            PostProcessMotionBlur motionBlur =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessMotionBlur).ToString())
                as PostProcessMotionBlur;

            int time = movieClip.GetStartTick();

            if (motionBlur != null)
            {
                movieClip.AddMotion(motionBlur.BlurIntensityRef, new CatFloat(0.2f), time,
                                    500);
            }
            PostProcessVignette vignette =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessVignette).ToString())
                as PostProcessVignette;

            if (vignette != null)
            {
                movieClip.AddMotion(vignette.RadiusRef, new CatVector2(0.0f, 1.4f), time, 500);
            }
            movieClip.Initialize();
        }
	void Start () {
		
		MovieClip overlay = new MovieClip( "uniSWF/Examples/common/swf/common_uniswf_overlay.swf:DemoOverlay" );
		stage.addChild( overlay );
		
		TextField txt = overlay.getChildByName<TextField>("txt");
		if( txt != null ) {
			txt.text = title;
		}
		
		MovieClip logo = overlay.getChildByName<MovieClip>("logo");
		logo.addEventListener( MouseEvent.CLICK, onLogoClick );
		
		Logger.instance.addEventListener( LogEvent.LOGEVENT, onLog );
		
		debug_txt = overlay.getChildByName<TextField>("debug_txt");
		
		if( !displayAtTop ) {
			overlay.y = Screen.height - overlay.height;
		}
		
		if( fadeAfter > 0 ) {
			Tweener.addTween( overlay, Tweener.Hash( "delay",fadeAfter, "time",3, "alpha",0 ) );
		}
	}
        protected void CreateClassHier(
            int x, int y, int w, int h)
        {
            MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h);

            //clip.Object = chain;
            // Back rectangle
            clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h);
            // Dots
            MovieClip dots = clip.CreateSubMovieClip(74, 0, w, h);

            //dots.Graphics.FillRectangle( Brushes.Wheat, 0, 0, w/4, h );
            for (int d = 0; d < 7; d++)
            {               // extra spacing in between disconnected chains?
                MovieClip dot = dots.CreateSubMovieClip(0, 0, 6, 6);
                if (d > 1)
                {
                    dot.Graphics.DrawEllipse(Pens.LightGreen, 0, 0, 5, 5);
                }
                else
                {
                    dot.Graphics.FillEllipse(Brushes.LightGreen, 0, 0, 5, 5);
                }
            }
            Space(2, 5, dots.Children, dots.Width);

            // Text
            MovieClip text = clip.CreateSubMovieClip(0, 0, w, h);

            //text.LeftString( "string name (31):   +(17)  .Split(\",\")(14)", Brushes.White);
            //text.LeftString( "string name (31):   +(17)  .Split(\",\")(14)", Brushes.White);
            text.LeftString("CalculateTaxes(  ,  ,  ,  ,  ,  ,  )", Brushes.White);
        }
        protected void DrawSessionGraph(MovieClip sessions, int w, int h)
        {
            MovieClip sessionBar = sessions.CreateSubMovieClip(0, h / 3, w, h - (h / 3));

            // Date
            MovieClip dateBar   = sessionBar.CreateSubMovieClip(0, sessionBar.Height / 2, w, sessionBar.Height / 2);
            MovieClip dateFront = dateBar.CreateSubMovieClip(0, 0, dateBar.Width / 2, dateBar.Height);

            dateFront.LeftString("10/10/05", Brushes.White);
            MovieClip dateEnd = dateBar.CreateSubMovieClip(dateBar.Width / 2, 0, dateBar.Width / 2, dateBar.Height);

            dateEnd.AlignedString("12/03/05", Brushes.White, StringAlignment.Far);

            //dateBar.Graphics.DrawRectangle(Pens.Sienna, 0, 0, dateBar.Width-1, dateBar.Height-1 );
            //sessionBar.Graphics.DrawRectangle( Pens.Sienna, 0, 0, sessionBar.Width -1 , sessionBar.Height - 1);

            Pen wideGray = new Pen(Brushes.Gray, 2);

            sessionBar.Graphics.DrawLine(wideGray, 0, sessionBar.Height / 2, sessionBar.Width, sessionBar.Height / 2);
            wideGray.Dispose();

            MovieClip sessionThumbs = sessionBar.CreateSubMovieClip(0, 0, sessionBar.Width, sessionBar.Height);

            for (int sIndex = 0; sIndex < 5; sIndex++)
            {
                MovieClip session = sessionThumbs.CreateSubMovieClip(0, 0, 10, 10);
                session.Graphics.FillRectangle(Brushes.Yellow, 0, 0, 9, 9);
            }
            Space(3, 2, sessionThumbs.Children, sessionThumbs.Width);
            MovieClip xx = sessionThumbs.Children[3];

            xx.X += 30;
        }
        private void session_MouseClick(object sender, MouseEventArgs e)
        {
            MovieClip ses = (MovieClip)sender;

            ses.Graphics.FillRectangle(Brushes.White, 0, 0, 9, 9);
            this.Invalidate();
        }
Example #12
0
        public void OnSuccess()
        {
            MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
            MovieClip       movieClip       = motionDelegator.AddMovieClip();

            movieClip.AppendMotion(Mgr <GameEngine> .Singleton.TimeScaleRef, new CatFloat(1.0f), 1000);
            PostProcessMotionBlur motionBlur =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessMotionBlur).ToString())
                as PostProcessMotionBlur;

            int time = movieClip.GetStartTick();

            if (motionBlur != null)
            {
                movieClip.AddMotion(motionBlur.BlurIntensityRef, new CatFloat(0.2f), time,
                                    1000);
            }
            PostProcessColorAdjustment colorAdjustment =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessColorAdjustment).ToString())
                as PostProcessColorAdjustment;

            if (colorAdjustment != null)
            {
                movieClip.AddMotion(colorAdjustment.IllumiateRef, new CatFloat(0.0f), time, 1000);
            }
            PostProcessVignette vignette =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessVignette).ToString())
                as PostProcessVignette;

            if (vignette != null)
            {
                movieClip.AddMotion(vignette.RadiusRef, new CatVector2(0.0f, 1.6f), time, 1000);
            }
            movieClip.Initialize();
        }
Example #13
0
    void Activate()
    {
        if (GameObject.Find("Main Camera").GetComponent<MovieClipOverlayCameraBehaviour>() == null)
        {
            return;
        }
        PauseStage = Camera.main.GetComponent<MovieClipOverlayCameraBehaviour>().stage;

        BackGround = new MovieClip("swf/PauseField.swf:FadeBackground");
        BackGround.gotoAndStop(1);
        BackGround.x = Screen.width / 2;
        BackGround.y = Screen.height / 2;
        BackGround.scaleX = (float)Screen.width / 2048;
        BackGround.scaleY = BackGround.scaleX;
        PauseStage.addChild(BackGround);

        for (int i = 0; i < ButtonCount; i++)
        {
            Buttons[i] = new MovieClip("swf/PauseField.swf:PauseField");
            Buttons[i].gotoAndStop(1);
            Buttons[i].x = Screen.width/2;
            Buttons[i].y = Screen.height * 0.3f + (float)Screen.height/2048 * 220 * i;
            Buttons[i].scaleX = (float)Screen.width / 2048;
            Buttons[i].scaleY = Buttons[i].scaleX;

            MenuFields[i] = Buttons[i].getChildByName<TextField>("Text");
            MenuFields[i].text = names[i];

            PauseStage.addChild(Buttons[i]);
        }

        Buttons[0].addEventListener(MouseEvent.CLICK, Resume);
        Buttons[1].addEventListener(MouseEvent.CLICK, Reload);
        Buttons[3].addEventListener(MouseEvent.CLICK, Quit);
    }
Example #14
0
        protected override bool Enter(Fixture _fixtureA, Fixture _fixtureB, Contact _contact)
        {
            if (m_player != null)
            {
                return(true);
            }

            if (_fixtureA.UserData == null && _fixtureB.UserData == null)
            {
                return(true);
            }

            m_player = Mgr <Scene> .Singleton._gameObjectList.
                       GetOneGameObjectByName(m_playerGameObjectName);

            QTE qte = m_player.GetComponent(typeof(QTE).ToString()) as QTE;

            if (qte.IsInQTE())
            {
                return(true);
            }
            // slow down and blur
            MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
            MovieClip       movieClip       = motionDelegator.AddMovieClip();

            movieClip.AppendMotion(Mgr <GameEngine> .Singleton.TimeScaleRef, new CatFloat(0.1f), 200);
            PostProcessMotionBlur motionBlur =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessMotionBlur).ToString())
                as PostProcessMotionBlur;

            int time = movieClip.GetStartTick();

            if (motionBlur != null)
            {
                movieClip.AddMotion(motionBlur.BlurIntensityRef, new CatFloat(0.98f), time,
                                    200);
            }
            PostProcessVignette vignette =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessVignette).ToString())
                as PostProcessVignette;

            if (vignette != null)
            {
                movieClip.AddMotion(vignette.RadiusRef, new CatVector2(0.0f, 0.9f), time, 200);
            }
            movieClip.Initialize();
            // qte
            int qteNum = 1 + m_random.Next(4);

            for (int i = 0; i < qteNum; ++i)
            {
                int     randKey = 65 + m_random.Next(90 - 65 + 1);
                QTEPack qtePack = new QTEPack((Keys)randKey, 800);
                qte.AppendEvent(qtePack);
            }
            qte.StartQTE(this);
            m_isInQTE = true;
            return(true);
        }
        public ParallelInheritanceHierarchyVisualization()
        {
            this.Width  = 1248;
            this.Height = 768;

            m_panelClip = new MovieClip(0, 0, this.Size);
            m_panelClip.Attach(this);
        }
        public HackVisualization()
        {
            this.Width  = 1248;
            this.Height = 768;

            m_panelClip = new MovieClip(0, 0, this.Size);
            m_panelClip.Attach(this);
        }
		public ParallelInheritanceHierarchyVisualization()
		{
			this.Width  = 1248;
			this.Height = 768;

			m_panelClip = new MovieClip( 0,0, this.Size );
			m_panelClip.Attach( this );
		}
		public HackVisualization()
		{
			this.Width  = 1248;
			this.Height = 768;

			m_panelClip = new MovieClip( 0,0, this.Size );
			m_panelClip.Attach( this );
		}
Example #19
0
 public UnitFrame(Unit unit)
 {
     this.unit = unit;
     frame = new MovieClip ("Flash GUI/game_gui.swf:unit_frame");
     unit_name = frame.getChildByName("unit_name") as TextField;
     unit_name.text = "8====D";
     unit_name.colorTransform = Color.black;
 }
Example #20
0
        public MovieClip AddMovieClip()
        {
            MovieClip movieClip = new MovieClip(this);

            motions.Add(movieClip);
            movieClip.Play();
            return(movieClip);
        }
Example #21
0
        private void DoAct()
        {
            MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
            MovieClip       movieClip       = motionDelegator.AddMovieClip();
            // logo
            ModelComponent logoModel =
                ModelComponent.GetModelOfGameObjectInCurrentScene(m_logoObjectName);

            if (logoModel != null)
            {
                movieClip.AppendMotion(
                    logoModel.GetCatModelInstance().GetMaterial().GetParameter("Alpha"),
                    new CatFloat(1.0f),
                    2000);
                movieClip.AppendEmptyTime(2000);
                movieClip.AppendMotion(
                    logoModel.GetCatModelInstance().GetMaterial().GetParameter("Alpha"),
                    new CatFloat(0.0f),
                    2000);
            }
            // intro
            ModelComponent introModel =
                ModelComponent.GetModelOfGameObjectInCurrentScene(m_introObjectName);

            if (introModel != null)
            {
                movieClip.AppendMovieClip(new PlayMusic(m_musicName));
                movieClip.AppendMotion(
                    introModel.GetCatModelInstance().GetMaterial().GetParameter("Alpha"),
                    new CatFloat(1.0f),
                    2000);
                movieClip.AppendEmptyTime(3000);
            }

            // storm
            int             timestamp = movieClip.GetEditCurClip();
            ParticleEmitter emitter   =
                ParticleEmitter.GetParticleEmitterOfGameObjectInCurrentScene(m_emitterObjectName);

            if (emitter != null)
            {
                movieClip.AppendMovieClip(new StormOn(emitter));
                movieClip.AppendMotion(emitter.GenerateRatePerSecondRef,
                                       new CatInteger(512), 5000);
            }

            // Screen bright
            PostProcessColorAdjustment colorAdjustment =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessColorAdjustment).ToString())
                as PostProcessColorAdjustment;

            if (colorAdjustment != null)
            {
                movieClip.AddMotion(colorAdjustment.IllumiateRef, new CatFloat(1.0f), timestamp, 5000);
            }
            movieClip.AppendMovieClip(new SwitchScene(m_nextSceneName));
            movieClip.Initialize();
        }
Example #22
0
        public LongMethodVisualization()
        {
            InitializeComponent();
            this.Width  = 800;
            this.Height = 600;

            m_panelClip = new MovieClip(0, 0, this.Size);
            m_panelClip.Attach(this);
        }
Example #23
0
        private void button2_Click(object sender, EventArgs e)
        {
            Lib.MovieClip mc = new MovieClip(webBrowser, "MovieClip1");
            PointF        f  = mc.localToGlobal(new PointF(11, 10));

            Console.WriteLine("X=" + f.X + " Y=" + f.Y);
            f = mc.globalToLocal(new PointF(f.X, f.Y));
            Console.WriteLine("X1=" + f.X + " Y1=" + f.Y);
        }
Example #24
0
 void Start()
 {
     ButtonField = Resources.Load("Prefabs/ButtonField") as GameObject;
     InfoField = new MovieClip("swf/Ellipse.swf:InfoField");
     InfoField.gotoAndStop(1);
     CannonName = InfoField.getChildByName<TextField>("CannonName");
     Cost = InfoField.getChildByName<TextField>("Cost");
     Info = InfoField.getChildByName<TextField>("Info");
 }
Example #25
0
		public LongMethodVisualization()
		{
			InitializeComponent();
			this.Width  = 800;
			this.Height = 600;

			m_panelClip = new MovieClip( 0,0, this.Size );
			m_panelClip.Attach( this );
		}
		public void AlignedString(MovieClip mc, string s, Brush brush, StringAlignment align, float size)
		{
			StringFormat sf = new StringFormat();
			sf.Alignment = align;
			sf.LineAlignment = align;
			Font f = new Font("Times", size);
			mc.Graphics.DrawString(s, f, brush, new Rectangle(0, 0, (int) (mc.Width * mc.Xscale), (int) (mc.Height * mc.Yscale)), sf);
		
		}
Example #27
0
	/**
	* Helper to set a movieclip as a screen.
	*/
	void setScreen( MovieClip mc ) {
		if( m_Screen != null ) {
			stage.removeChild( m_Screen );
		}
		m_Screen = mc;
		if( m_Screen != null ) {
			stage.addChild( m_Screen );			
		}
	}
		public TemporaryFieldVisualization()
		{
			this.Width  = 1248;
			this.Height = 768;

			m_panelClip = new MovieClip( 0,0, this.Size );
			m_panelClip.Attach( this );
			
			m_panelClip.MouseClick+=new MouseEventHandler(OnMouseClickClass);
		}
        public TemporaryFieldVisualization()
        {
            this.Width  = 1248;
            this.Height = 768;

            m_panelClip = new MovieClip(0, 0, this.Size);
            m_panelClip.Attach(this);

            m_panelClip.MouseClick += new MouseEventHandler(OnMouseClickClass);
        }
Example #30
0
 private void OnDestroy()
 {
     for (int _idx = 0; _idx < mainMovieClipList.Count; _idx++)
     {
         MovieClip _v2 = mainMovieClipList[_idx];
         _v2.removeFromParent();
     }
     mainMovieClipList.Clear();
     _instance = null;
 }
Example #31
0
        public SwitchStatementVisualization()
        {
            this.Width  = 1248;
            this.Height = 768;

            m_panelClip = new MovieClip(0, 0, this.Size);
            m_panelClip.Attach(this);

            m_panelClip.MouseClick += new MouseEventHandler(OnMouseClickMethod);
        }
		public SwitchStatementVisualization()
		{
			this.Width  = 1248;
			this.Height = 768;

			m_panelClip = new MovieClip( 0,0, this.Size );
			m_panelClip.Attach( this );
			
			m_panelClip.MouseClick+=new MouseEventHandler(OnMouseClickMethod);
		}
        public void AlignedString(MovieClip mc, string s, Brush brush, StringAlignment align, float size)
        {
            StringFormat sf = new StringFormat();

            sf.Alignment     = align;
            sf.LineAlignment = align;
            Font f = new Font("Times", size);

            mc.Graphics.DrawString(s, f, brush, new Rectangle(0, 0, (int)(mc.Width * mc.Xscale), (int)(mc.Height * mc.Yscale)), sf);
        }
        protected void TaskView(int x, int y, int w, int h)
        {
            MovieClip taskView = m_panelClip.CreateSubMovieClip(x, y, w, h);
            MovieClip taskSumm = taskView.CreateSubMovieClip(0, 0, w, h / 2);
            MovieClip session  = taskView.CreateSubMovieClip(0, h / 2, w, h / 2);

            TaskSummary(taskSumm, w, h / 2);
            SessionSummary(session, w, h / 2, 5);

            m_panelClip.MouseClick += new MouseEventHandler(session_MouseClick);
        }
Example #35
0
    public override void OnInspectorGUI()
    {
        MovieClip _movieClip       = target as MovieClip;
        bool      _spriteFromAltas = EditorGUILayout.Toggle("spriteFromAltas", _movieClip.spriteFromAltas);

        if (_movieClip.spriteFromAltas != _spriteFromAltas)
        {
            _movieClip.spriteFromAltas = _spriteFromAltas;
        }
        base.DrawDefaultInspector();
    }
Example #36
0
        private void TestMovieClip()
        {
            List <Texture> li = new List <Texture> {
                textures[0], textures[1]
            };
            MovieClip mc = new MovieClip(li, 3);

            AddChild(mc);
            mc.X = mc.Y = 444;
            SparrowSharp.DefaultJuggler.Add(mc);
        }
Example #37
0
    public static flash.display.Sprite getPicNodeAndAddTo(MovieClip mainMovieClip_, Transform parent_)
    {
        flash.display.Sprite sprite = GameObject.Instantiate(_spriteCache);
        sprite.setMainMovieClip(mainMovieClip_);
        Transform _spTrans = sprite.transform;

        _spTrans.parent        = parent_;
        _spTrans.localPosition = new Vector3(0f, 0f, 0f);
        _spTrans.localScale    = new Vector3(1f, 1f, 1f);
        return(sprite);
    }
Example #38
0
    public TeamFrame(List<Unit> units)
    {
        this.units = units;
        frame = new MovieClip ("Flash GUI/game_gui.swf:team_frame");

        foreach(Unit unit in units){
            UnitFrame unit_frame = new UnitFrame(unit);
            unitFrames.Add(unit_frame);
        }

        PopulateFrame();
    }
Example #39
0
	/**
	* Show menu
	*/
	void showMenu () {
	
		// Load screen
		MovieClip screen = new MovieClip( "uniSWF/Examples/Example 05 - Fluid layouts/swf/fluidDemo.swf:Menu" );
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn1"), "PLAY", onMenuPlay ); 
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn2"), "OPTIONS", delegate( CEvent e ) { Debug.Log("Options CLICK!");}  ); // does nothing
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn3"), "EXIT", delegate( CEvent e ) { 
			Logger.instance.log(Logger.LEVEL_INFO,"Exit CLICK! ");			
		}  ); // does nothing
		
		// Add event listeners	
		setScreen( screen );
	}
Example #40
0
	/**
	* Create world select
	*/
	void showWorldSelect() {
		// Load screen
		MovieClip screen = new MovieClip( "uniSWF/Examples/Example 05 - Fluid layouts/swf/fluidDemo.swf:WorldSelect" );
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn_back"), "BACK", onBackToMenu ); 
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn_shop"), "SHOP", delegate( CEvent e ) { Debug.Log("Shop CLICK!");}  ); // does nothing
		
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn_world1"), "1", onSelectWorld ); 
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn_world2"), "2", onSelectWorld ); 
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn_world3"), "3", onSelectWorld ); 
		
		// Add event listeners	
		setScreen( screen );
	}
Example #41
0
    void GenerateEllipse()
    {
        Ellipse = new MovieClip("swf/Ellipse.swf:Elipse");


        Ellipse.gotoAndStop(1);

        Ellipse.x = (GeneratePosition.x + 405) * Screen.width / ScaleX;
        Ellipse.y = -1 * (GeneratePosition.z - 242) * Screen.height / ScaleY;
        Ellipse.scaleX = (float)Screen.width / ScaleParameter;
        Ellipse.scaleY = Ellipse.scaleX;

        stage.addChild(Ellipse);
    }
        protected void OnMouseClickMethod(object sender, MouseEventArgs e)
        {
            MovieClip clip = (MovieClip)sender;

            if (clip.Object != null)
            {
                MethodComponent mc = (MethodComponent)clip.Object;
                if (mc.CodeFunction != null)
                {
                    CodeFunction cf = (CodeFunction)mc.CodeFunction;
                    SelectObjectMethod(cf);
                }
            }
        }
Example #43
0
    public PreloaderBar()
    {
        var i10 = new symbol_0()
        {
            filters = new as3.Array(new object[] {})
        };

        addChild(i10);        //0
        line = new symbol_2()
        {
            x = -122, scaleX = 0, y = -3, filters = new as3.Array(new object[] {}), scale9Grid = new flash.geom.Rectangle(3, 2, 141, 1)
        };
        addChild(line);        //1
    }
        protected void OnMouseClickClass(object sender, MouseEventArgs e)
        {
            MovieClip clip = (MovieClip)sender;

            if (clip.Object != null)
            {
                ClassComponent mc = (ClassComponent)clip.Object;
                if (mc.CodeClass != null)
                {
                    CodeClass cc = (CodeClass)mc.CodeClass;
                    SelectObjectClass(cc);
                }
            }
        }
Example #45
0
	void Start ( ) {
		
		// 
		// Alter existing font
		
		// Add root with single textfield
		mc = new MovieClip( "uniSWF/Examples/Extra examples/ProgramaticTextFields/swf/programaticText.swf:Root" ) ;
		stage.addChild( mc );
		
		// Ensure player is not changing textfields on timeline
		mc.stop();
		
		 // Get textfield
		txt = mc.getChildByName<TextField>( "txt" );
		
		// Get format
		TextFormat format = txt.textFormat;
		
		// Set new format
		format.fontClassName = null;	// Clear class for bitmap fonts as this points to the exact font_size_filters assets
		format.size = 30;
		
		// Set format
		txt.textFormat = format;
		
		
		
		//
		// Add new textfield using font and size ( must be exported )		
		format = new TextFormat();
		format.font = "Times Bold";
		format.color = Color.green;
		format.size = 64;
		BitmapTextField bmpTxt = new BitmapTextField( );
		bmpTxt.width = 500;
		bmpTxt.height = 200;
		bmpTxt.textFormat = format;		
		bmpTxt.text = "Text set from code";
		bmpTxt.y = 100;
		bmpTxt.x = 10;
		
		bmpTxt.type = TextFieldType.INPUT;
		
		bmpTxt.addCharColor( 5, 8, Color.cyan );
		bmpTxt.addCharColor( 14, 17, Color.red );
		
		bmpTxt.appendText( ", Appended text" );
		stage.addChild( bmpTxt );		
	}
Example #46
0
    void Start()
    {
        //Create instances of MovieClip by code.
        FlashUtils.getMovieClipByClassNameAndAddTo("Game_ShootGameDis", transform).selfTrans.position = new Vector3(0f, -2f, 0f);

        FlashUtils.getMovieClipByClassNameAndAddTo("Animation_PerformanceTest", transform).selfTrans.position = new Vector3(0f, -3.22f, 0f);
        MovieClip _upMovieClip = FlashUtils.getMovieClipByClassNameAndAddTo("Animation_PerformanceTest", transform);

        _upMovieClip.selfTrans.position = new Vector3(0f, 3.22f, 0f);
        _upMovieClip.selfTrans.rotation = Quaternion.Euler(new Vector3(0f, 0f, 180f));
        _upMovieClip.gotoAndStop(_upMovieClip.mcTimeLineInfo.totalFrames);//All frog add to stage at same frame.Then stop as last frame.

        FlashUtils.getMovieClipByClassNameAndAddTo("Trail_DisTrailBackAndForthGroupCircle", transform).selfTrans.position = new Vector3(4f, 2.5f, 0f);
        FlashUtils.getMovieClipByClassNameAndAddTo("Trail_DisTrailLineRotate", transform).selfTrans.position = new Vector3(-4f, 2.5f, 0f);
    }
Example #47
0
	void Start () {
	
		Stage stage = MovieClipOverlayCameraBehaviour.instance.stage;
		MovieClip mc = new MovieClip( "uniSWF/Examples/Extra examples/Touch keyboard integration/swf/touchInputExample.swf:Root" );
		stage.addChild( mc );
		ScreenUtils.center( stage, mc );
		mc.y = 100; // allow room for keybaord
		
		// Listen for specific focus events
		//TextField txt = mc.getChildByName<TextField>("txt");		
		//bindTextFieldTouchInputEvents( txt );	// Bind touch input
		
		// Listen for any input texts
		listenForAllFocusEvents( stage );
		
	}
Example #48
0
 public CaveMan()
 {
     Container = new Container();
     idle      = new MovieClip(new[] { App.Textures.CaveManMenu0, App.Textures.CaveManMenu1 })
     {
         Loop           = true,
         AnimationSpeed = 0.05f
     };
     Container.AddChild(idle);
     emotions = new Sprite(App.Textures.CaveManMenu2)
     {
         Visible = false
     };
     Container.AddChild(emotions);
     idle.Play();
 }
Example #49
0
 private void reloadHull()
 {
     if (player.ship.getHull() != null)
     {
         hull_view.removeEventListener(MouseEvent.CLICK, onClick);
         removeChild(hull_view);
         hull_view = new MovieClip();
         hull_view.addEventListener(MouseEvent.CLICK, onClick);
         hull_view.load(new string[] { "DATA\\Ships\\" + player.ship.getHull().type + ".png" });
         hull_view.width = 50;
         hull_view.moveAxisToCenter();
         hull_view.stop();
         hull_view.x = hull_view.x + 5;
         addChild(hull_view);
     }
 }
Example #50
0
	IEnumerator Start () {
		
#if UNITY_EDITOR		
		if( !UnityEditorInternal.InternalEditorUtility.HasPro() ) {
			Debug.LogError( "Unity PRO required to load asset bundles" );
			yield break;
		}
#endif
		// Bundle path relative to project, please note this will not work in the webplayer, you will need to upload and change the www path accordingly
		string assetBundlePath = "file://" + Application.dataPath + "/uniSWF/Examples/Extra examples/AssetBundleLoading/assetBundles/assetBundleAssets0.unity3d";
		
		WWW www = new WWW( assetBundlePath );
		
		yield return www;
			
		if( www.error != null ) {
			Debug.LogError( "Failed to load asset bundle" );
			yield break;
		}
		
		Debug.Log( "Asset bundle loaded, adding to resource loader" );
		
		// Add asset bundle
		BuiltinResourceLoader loader = MovieClip.rootResourceLoader as BuiltinResourceLoader;
		loadedBundle = www.assetBundle;
		loader.addAssetBundle( loadedBundle );
		
		// Load swf
		MovieClip mc = new MovieClip( "assetBundleAssets0.swf:Zombie" );
		mc.stop();
		Stage stage = MovieClipOverlayCameraBehaviour.instance.stage;
		stage.addChild( mc );

		ScreenUtils.center( stage, mc );
		
		// Unload btn
		MovieClip btn = new MovieClip( "assetBundleAssets0.swf:btn_ui" );
		stage.addChild( btn );
		btn.x += btn.width;
		btn.y += btn.height;
		ScreenUtils.createButtonWithLabel( btn, "Unload", onUnloadAssetBundle );
		
		yield break;
	}
Example #51
0
    /**
    * Intiailise HUD
    */
    void Start () {	    
	    mainLight = GameObject.Find("MainLight").GetComponent<Light>();
	    panelState = STATE_IDLE;
	
	    mc = gameObject.GetComponent<MovieClipBehaviour>();
	    if( mc == null ) {
		    Debug.LogError( "MovieClipBehaviour missing on '" + name + "'" );
		    return;
	    }
	    clip = mc.movieClip;
	
	    // Set default player mode
	    initDisabledInteraction();
	    clip.gotoAndStop( 1 );
	    mainLight.intensity = minMainLight;
	
	    startScale.x = mc.stage.scaleX;
	    startScale.y = mc.stage.scaleY;
    }
Example #52
0
	void ShowLevelComplete(int Level) {
        if (GameObject.Find("Main Camera").GetComponent<MovieClipOverlayCameraBehaviour>() == null)
        {
            return;
        }
        st = Camera.main.GetComponent<MovieClipOverlayCameraBehaviour>().stage;
      
        ChangeLevel = new MovieClip("swf/LevelPassed.swf:LevelUP");
        
 
       
        ChangeLevel.x = Screen.width / 2;
        ChangeLevel.y = Screen.height / 2;
        ChangeLevel.scaleX = (float)Screen.width / 2048;
        ChangeLevel.scaleY = ChangeLevel.scaleX;

        Text = ChangeLevel.getChildByName<TextField>("Layer1");
        Text.text = "Level  " + Level.ToString();
        st.addChild(ChangeLevel);
        ChangeLevel.gotoAndPlay(1);
        Playing = true;
	}
Example #53
0
	/**
	* Create level select.
	*/
	void showLevelSelect() {
		// Load screen
		MovieClip screen = new MovieClip( "uniSWF/Examples/Example 05 - Fluid layouts/swf/fluidDemo.swf:LevelSelect" );
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn_back"), "BACK", onBackToMenu ); 
		
		// Add level buttons
		for( int i=0;i<9;i++) {
			MovieClip btn = screen.getChildByName<MovieClip>("btn_level" + (i+1) );
			ScreenUtils.createButton( btn, onSelectLevel ); 
			MovieClip btnInner = btn.getChildByName<MovieClip>( "inner");
			
			if( i>=8) { // show locked
				btnInner.gotoAndStop( "locked" );
			} else {
				btnInner.gotoAndStop( "normal" );
				TextField txt = btnInner.getChildByName<TextField>( "txt" );
				txt.text = "" + (i+1);
			}
		}
		
		// Add event listeners	
		setScreen( screen );
	}
		protected void LineTo( MovieClip clip, int d1, int d2, int w, int h, Pen pen )
		{
			int of = w/2 - 3;
			clip.Graphics.DrawLine( pen, (6+3)*(1+d1)+of, 6, (6+3)*(1+d2)+of, h/2 + 6 );
		}
		public void AlignedString(MovieClip mc, string s, Brush brush, StringAlignment align)
		{
			AlignedString( mc, s, brush, align, 12f );
		}
		protected void TaskSummary( MovieClip clip, int w, int h )
		{
			clip.Graphics.FillRectangle( m_backBrush, 0, 0, w, h);
			clip.Graphics.DrawRectangle( Pens.SlateGray, 0, 0, w-1, h-1 );
			
			// ID Zone
			MovieClip idLabel  = clip.CreateSubMovieClip( 0  , 0, w/12, h );
			AlignedString( idLabel, "T1", Brushes.White, StringAlignment.Center );
			MovieClip editNav  = clip.CreateSubMovieClip( w/12, 0, w/12, h );
			MovieClip edit = editNav.CreateSubMovieClip( 0, 0, w/24, h );
			MovieClip nav = editNav.CreateSubMovieClip( w/24, 0, w/24, h );

			//edit.Graphics.DrawRectangle( Pens.Sienna, 0, 0, edit.Width-1, edit.Height-1 );
			//nav.Graphics.DrawRectangle( Pens.Sienna, 0, 0, nav.Width-1, nav.Height-1 );
			
			int eb_h = (int)(h*.45);
			int eb_w = (int)(h*.45);
			GradientPainter.Fill3DSphere( edit, Color.Green, Color.White, edit.Width/2-eb_w/2, edit.Height/2-eb_h/2, eb_w, eb_h );
			edit.CenteredString( "33", Brushes.White );
			edit.Graphics.DrawEllipse( Pens.DarkGreen, edit.Width/2-eb_w/2, edit.Height/2-eb_h/2, eb_w, eb_h );

			GradientPainter.Fill3DSphere( nav, Color.Blue, Color.White, nav.Width/2-eb_w/2, nav.Height/2-eb_h/2, eb_w, eb_h );
			nav.CenteredString( "15", Brushes.White );
			nav.Graphics.DrawEllipse( Pens.DarkGreen, nav.Width/2-eb_w/2, nav.Height/2-eb_h/2, eb_w, eb_h );

			// TAG CLOUD
			MovieClip tagCloud = clip.CreateSubMovieClip( w/6, 0, w/2, h );
			//tagCloud.LeftString( "lock(3) DB(2)", Brushes.White );
			AlignedString( tagCloud, "AUTOTAGS:", Brushes.LightGray, StringAlignment.Near, 7 );
			AlignedString( tagCloud, "Lock(3), Oracle(2)", Brushes.White, StringAlignment.Center );
			
			MovieClip sessions = clip.CreateSubMovieClip( 2*w/3, 0, w/3, h );
			AlignedString( sessions, "SESSIONS:", Brushes.LightGray, StringAlignment.Near, 7 );
			DrawSessionGraph( sessions, sessions.Width, sessions.Height );
		}
Example #57
0
	void showHud() {
		// Load screen
		MovieClip screen = new MovieClip( "uniSWF/Examples/Example 05 - Fluid layouts/swf/fluidDemo.swf:Hud" );
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn_pause"), "", onBackToMenu ); 
		ScreenUtils.createButtonWithLabel( screen.getChildByName<MovieClip>("btn_sound"), "", delegate( CEvent e) { Debug.Log("Sound CLICK!");} ); 
		
		// Add event listeners	
		setScreen( screen );
	}
Example #58
0
    public void GetMovieClip()
    {
        mMovieClipBehaviour = GetComponent<InteractiveMovieClipBehaviour>();

        if (mMovieClipBehaviour != null)
        {
            if (mMovieClipButtonName.Length > 0)
            {
                mMovieClipButton = mMovieClipBehaviour.movieClip.getChildByName<MovieClip>(mMovieClipButtonName);
            }
            else
            {
                mMovieClipButton = mMovieClipBehaviour.movieClip;
            }

            if (mMovieClipButton != null)
            {
                mMovieClipButton.gotoAndStop(mDefaultFrame);
            }
            else
            {
                //Debug.LogWarning("Movie clip " + mMovieClipButtonName + " not found !");
            }
        }
    }
Example #59
0
	public float scaleY = 1; // sycned

	void Start () {
	

		// Direct usage example
        scale9Mc = new Scale9MovieClip("uniSWF/Examples/Extra examples/Custom Scale9/swf/scale9Example.swf:ButtonSliceExample1");
		MovieClipOverlayCameraBehaviour.instance.stage.addChild (scale9Mc);

		// Usage inside timeline example
		MovieClip.registerGlobalLinkage ("ButtonSliceExample1", typeof(Scale9MovieClip)); // Link swf symbol ButtonSliceExample1 to use Scale9MovieClip as a base class
        timelineScale9Mc = new MovieClip("uniSWF/Examples/Extra examples/Custom Scale9/swf/scale9Example.swf:TimelineUseCaseExample");
		MovieClipOverlayCameraBehaviour.instance.stage.addChild (timelineScale9Mc);

	}
Example #60
0
    void Start()
    {
        gm = GameObject.Find("GameManager").GetComponent<GameManager>();
        bm = GameObject.Find("BattleManager").GetComponent<BattleManager>();
        em = GameObject.Find("EventManager").GetComponent<EventManager>();

        // validate MovieClipOverlayCameraBehaviour ist attached to camera
        if (MovieClipOverlayCameraBehaviour.instance == null) {
            return;
        }

        // assign stage reference
        stage = MovieClipOverlayCameraBehaviour.instance.stage;

        //bottom timeline
        menu = new MovieClip ("Flash GUI/game_gui.swf:hover_menu");
        move_button = (MovieClip)menu.getChildByName ("move_btn");
        attack_button = (MovieClip)menu.getChildByName ("attack_btn");
        defend_button = (MovieClip)menu.getChildByName ("defend_btn");
        magic_button = (MovieClip)menu.getChildByName ("magic_btn");
        wait_button = (MovieClip)menu.getChildByName ("wait_btn");

        move_button.addEventListener(MouseEvent.CLICK, onMoveButton);
        attack_button.addEventListener(MouseEvent.CLICK, onAttackButton);
        defend_button.addEventListener(MouseEvent.CLICK, onDefendButton);
        magic_button.addEventListener(MouseEvent.CLICK, onSpellButton);
        wait_button.addEventListener(MouseEvent.CLICK, onWaitButton);

        //create a list and store buttons in list
        buttonList = new List<MovieClip> ();
        buttonList.Add (move_button);
        buttonList.Add (attack_button);
        buttonList.Add (defend_button);
        buttonList.Add (magic_button);
        buttonList.Add (wait_button);

        menu.x = 100;
        menu.y = 100;
        menu.scaleX = scale_factor;
        menu.scaleY = scale_factor;

        //add listeners to each button in the list and stop the animations from playing
        updateListeners (buttonList);

        stage.addChild (menu);

        menu.visible = false;

        em.UnitsReadyEvent += make_team_frame;
    }