protected override void ExecuteCore()
        {
            actor.parent.childs.Add(actor);
            TScene scene = actor.ownerScene();

            document.sceneManager.updateThumbnail(scene);
        }
 public DeleteSceneAction(TDocument doc, FrmMainContainer mainForm, int sceneIndex, TScene scene)
 {
     this.document   = doc;
     this.mainForm   = mainForm;
     this.sceneIndex = sceneIndex;
     this.scene      = scene;
 }
        protected override void UnExecuteCore()
        {
            actor.name      = original.name;
            actor.draggable = original.draggable;
            actor.acceleratorSensibility = original.acceleratorSensibility;
            actor.anchor          = original.anchor;
            actor.position        = original.position;
            actor.scale           = original.scale;
            actor.skew            = original.skew;
            actor.rotation        = original.rotation;
            actor.backgroundColor = original.backgroundColor;
            actor.alpha           = original.alpha;
            actor.zIndex          = original.zIndex;

            actor.interactionBound     = original.interactionBound;
            actor.autoInteractionBound = original.autoInteractionBound; // must assign autoInteractionBound after assin interaction bound, because interactionBound setting will change autoInteractionBound property

            actor.puzzleArea = original.puzzleArea;
            actor.puzzle     = original.puzzle;

            if (actor is TTextActor)
            {
                TTextActor textActor = actor as TTextActor;
                textActor.text    = original.text;
                textActor.font    = original.font;
                textActor.color   = original.color;
                textActor.boxSize = original.boxSize;
            }

            TScene scene = actor.ownerScene();

            document.sceneManager.updateThumbnail(scene);
        }
Пример #4
0
        public override void draw(Graphics g)
        {
            // alpha
            float al = this.alphaFromScreen();

            if (al > 1e-10) {  // alpha > 0
                // save graphics
                GraphicsState gs = g.Save();

                // apply matrix
                g.MultiplyTransform(matrix);

                // background
                g.FillRectangle(new SolidBrush(Color.FromArgb((int)(al * this.backgroundColor.A), this.backgroundColor)), this.bound());

                // draw text
                TScene scene = this.ownerScene();
                if (scene == null || scene.run_emulator == null || scene.run_emulator.textOn) {
                    if (1 - al < 1e-10) { // if alpha == 1
                        g.DrawString(this.text, this.font, new SolidBrush(this.color), this.bound());
                    } else {
                        g.DrawString(this.text, this.font, new SolidBrush(Color.FromArgb((int)(al * 255), this.color)), this.bound());
                    }
                }

                // draw childs
                List<TActor> items = this.sortedChilds();
                for (int i = 0; i < items.Count; i++) {
                    items[i].draw(g);
                }

                // restore graphics
                g.Restore(gs);
            }
        }
Пример #5
0
        public void transitScene(TScene scene)
        {
            if (transitionDelegate != null)
            {
                transitionDelegate(transitionStartTime + 100000);
            }

            nextScene           = (TScene)scene.clone();
            transitionStartTime = sw.ElapsedMilliseconds;
            transitionDelegate  = delegate(long time)
            {
                const int duration = 400; //ms
                int       elapsed  = (int)(time - transitionStartTime);
                if (elapsed >= duration / 2 && nextScene != null)
                {
                    changeScene(nextScene);
                    nextScene = null;
                }

                if (elapsed >= duration)
                {
                    elapsed            = duration;
                    transitionDelegate = null;
                }

                if (elapsed < duration / 2)
                {
                    currentScene.alpha = 1 - elapsed / (duration / 2f);
                }
                else
                {
                    currentScene.alpha = elapsed / (duration / 2f) - 1;
                }
            };
        }
        public ModifySceneAction(TDocument doc, TScene scene)
        {
            this.document = doc;
            this.scene    = scene;
            this.original = new SceneData();
            this.final    = new SceneData();

            setOriginalData(scene);
        }
        protected override void UnExecuteCore()
        {
            actor.image = oldImage;
            actor.loadImage();

            TScene scene = actor.ownerScene();

            document.sceneManager.updateThumbnail(scene);
        }
Пример #8
0
        public void addScene(TScene scene)
        {
            Scenes.Add(scene);
            Thumbnails.Images.Add(scene.thumbnailImage());

            if (Scenes.Count == 1)
            {
                this.currentSceneIndex = 0;
            }
        }
Пример #9
0
        public void gotoSpecificScene(string sceneName)
        {
            TScene scene = document.findScene(sceneName);

            if (scene != null)
            {
                this.transitScene(scene);
                this.pnlDisplayBox.Invalidate();
            }
        }
        protected override void UnExecuteCore()
        {
            // clear selection
            document.selectedItems.Remove(actor);

            actor.parent.childs.Remove(actor);
            TScene scene = actor.ownerScene();

            document.sceneManager.updateThumbnail(scene);
        }
 public void setFinalData(TScene scene)
 {
     final.name                  = scene.name;
     final.backgroundColor       = scene.backgroundColor;
     final.touchIndication       = scene.touchIndication;
     final.prevButtonVisible     = scene.prevButtonVisible;
     final.nextButtonVisible     = scene.nextButtonVisible;
     final.backgroundMusic       = scene.backgroundMusic;
     final.backgroundMusicVolume = scene.backgroundMusicVolume;
 }
Пример #12
0
 public void updateThumbnail(TScene scene)
 {
     for (int i = 0; i < Scenes.Count; i++)
     {
         if (Scenes[i] == scene)
         {
             this.updateThumbnail(i);
             return;
         }
     }
 }
Пример #13
0
        protected override void clone(TLayer target)
        {
            base.clone(target);

            TScene targetLayer = (TScene)target;

            targetLayer.touchIndication       = this.touchIndication;
            targetLayer.prevButtonVisible     = this.prevButtonVisible;
            targetLayer.nextButtonVisible     = this.nextButtonVisible;
            targetLayer.backgroundMusic       = this.backgroundMusic;
            targetLayer.backgroundMusicVolume = this.backgroundMusicVolume;
        }
Пример #14
0
 public void insertScene(TScene scene, int index)
 {
     for (int i = index; i < Scenes.Count; i++)
     {
         Thumbnails.Images.RemoveAt(index);
     }
     Scenes.Insert(index, scene);
     for (int i = index; i < Scenes.Count; i++)
     {
         Thumbnails.Images.Add(Scenes[i].thumbnailImage());
     }
 }
Пример #15
0
        private void InitializeEmulator()
        {
            // borderless form
            BackColor       = Color.Magenta;
            TransparencyKey = Color.Magenta;

            soundEmulator = null;
            currentScene  = null;

            if (type == EmulatorType.Phone)
            {
                // phone
                this.BackgroundImage = Properties.Resources.emulator_phone;

                // buttons
                btnExit.BackgroundImage      = Properties.Resources.emulator_phone_exit;
                btnRelaunch.BackgroundImage  = Properties.Resources.emulator_phone_relaunch;
                btnSnapshoot.BackgroundImage = Properties.Resources.emulator_phone_snapshoot;

                btnExit.Location      = new Point(640, 27);
                btnRelaunch.Location  = new Point(640, 152);
                btnSnapshoot.Location = new Point(640, 276);

                pnlDisplayBox.Location = new Point(133, 28);
                pnlDisplayBox.Size     = new Size(480, 320);
            }
            else if (type == EmulatorType.Tablet)
            {
                // form
                this.BackgroundImage = Properties.Resources.emulator_tablet;

                // buttons
                btnExit.BackgroundImage      = Properties.Resources.emulator_tablet_exit;
                btnRelaunch.BackgroundImage  = Properties.Resources.emulator_tablet_relaunch;
                btnSnapshoot.BackgroundImage = Properties.Resources.emulator_tablet_snapshoot;

                btnExit.Location      = new Point(1183, 44);
                btnRelaunch.Location  = new Point(1183, 396);
                btnSnapshoot.Location = new Point(1183, 746);

                pnlDisplayBox.Location = new Point(127, 46);
                pnlDisplayBox.Size     = new Size(1024, 768);
            }

            // form
            this.Size = this.BackgroundImage.Size;

            // buttons
            btnExit.Size      = btnExit.BackgroundImage.Size;
            btnRelaunch.Size  = btnRelaunch.BackgroundImage.Size;
            btnSnapshoot.Size = btnSnapshoot.BackgroundImage.Size;
        }
Пример #16
0
        public TScene prevScene(TScene scene)
        {
            int sceneIndex = sceneManager.indexOfScene(scene.name);

            if (sceneIndex > 0)
            {
                return(sceneManager.scene(sceneIndex - 1));
            }
            else
            {
                return(sceneManager.scene(sceneManager.sceneCount() - 1));
            }
        }
Пример #17
0
        public TScene nextScene(TScene scene)
        {
            int sceneIndex = sceneManager.indexOfScene(scene.name);

            if (sceneIndex + 1 < sceneManager.sceneCount())
            {
                return(sceneManager.scene(sceneIndex + 1));
            }
            else
            {
                return(sceneManager.scene(0));
            }
        }
        protected override void UnExecuteCore()
        {
            for (int i = actorDatas.Count - 1; i >= 0; i--)
            {
                ActorData actorData = actorDatas[i];
                actorData.parent.childs.Insert(actorData.index, actorData.actor);
            }

            if (actorList.Count > 0)
            {
                TActor actor = actorList[0];
                TScene scene = actor.ownerScene();
                document.sceneManager.updateThumbnail(scene);
            }
        }
        protected override void ExecuteCore()
        {
            TScene scene = document.sceneManager.scene(oldIndex);

            document.sceneManager.deleteScene(oldIndex);

            if (oldIndex > newIndex)
            {
                document.sceneManager.insertScene(scene, newIndex);
                mainForm.getScenesList().SelectedIndex = newIndex;
            }
            else
            {
                document.sceneManager.insertScene(scene, newIndex - 1);
                mainForm.getScenesList().SelectedIndex = newIndex - 1;
            }
        }
Пример #20
0
        public bool isUsingSound(string snd)
        {
            // check document properties
            if (backgroundMusic.Equals(snd))
            {
                return(true);
            }

            // check scenes
            for (int i = 0; i < sceneManager.sceneCount(); i++)
            {
                TScene scene = sceneManager.scene(i);
                if (scene.isUsingSound(snd))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #21
0
        public void changeScene(TScene scene)
        {
            // stop/free all sounds and effects of current scene
            finishCurrentScene();

            // assign new scene to current scene
            currentScene = (TScene)scene.clone();
            currentScene.run_emulator    = this;
            currentScene.run_matrix      = matrixOfEmulator();
            currentScene.run_extraActors = extraActorsOfEmulator(currentScene);

            // scene have owner bgm
            if (currentScene.backgroundMusic != "")
            {
                playBGM(currentScene.backgroundMusic, currentScene.backgroundMusicVolume);
            }

            // fire enter event
            currentScene.fireEvent(Program.DEFAULT_EVENT_ENTER, true);
        }
        protected override void ExecuteCore()
        {
            actorDatas.Clear();
            document.selectedItems.Clear();

            actorList.ForEach((actor) => {
                if (actor.parent != null)
                {
                    actorDatas.Add(new ActorData {
                        actor = actor, parent = actor.parent, index = actor.parent.childs.IndexOf(actor)
                    });
                    actor.parent.childs.Remove(actor);
                }
            });

            if (actorList.Count > 0)
            {
                TActor actor = actorList[0];
                TScene scene = actor.ownerScene();
                document.sceneManager.updateThumbnail(scene);
            }
        }
Пример #23
0
        public bool parseXml(XElement xml)
        {
            if (xml == null || xml.Name != "Scenes")
            {
                return(false);
            }

            IEnumerable <XElement> xmlSceneList = xml.Elements();

            foreach (XElement xmlScene in xmlSceneList)
            {
                TScene scene = new TScene(document);
                if (!scene.parseXml(xmlScene, null))
                {
                    return(false);
                }

                addScene(scene);
            }

            return(true);
        }
Пример #24
0
        public void drawWorkspace(Graphics g, float width, float height)
        {
            // clear workspace
            g.Clear(Color.FromArgb(250, 250, 250));

            TScene scene = this.currentScene();

            if (scene != null)
            {
                // calc matrix
                workspaceMatrix.Reset();
                workspaceMatrix.Translate(width / 2 + offset.X, height / 2 + offset.Y);
                workspaceMatrix.Scale(zoom, zoom);
                workspaceMatrix.Translate(-0.5F * Program.BOOK_WIDTH, -0.5F * Program.BOOK_HEIGHT);

                // border of work area
                PointF[] aPos = { new PointF(0, 0), new PointF(Program.BOOK_WIDTH, Program.BOOK_HEIGHT) };
                workspaceMatrix.TransformPoints(aPos);
                aPos[0].X = (float)Math.Ceiling(aPos[0].X - 1);
                aPos[0].Y = (float)Math.Ceiling(aPos[0].Y - 1);
                aPos[1].X = (float)Math.Ceiling(aPos[1].X + 1);
                aPos[1].Y = (float)Math.Ceiling(aPos[1].Y + 1);
                g.DrawRectangle(new Pen(Color.FromArgb(198, 198, 198)), aPos[0].X, aPos[0].Y, aPos[1].X - aPos[0].X - 1, aPos[1].Y - aPos[0].Y - 1);

                // apply matrix
                GraphicsState gs = g.Save();
                g.MultiplyTransform(workspaceMatrix);

                // draw scene
                scene.draw(g);

                // restore graphics
                g.Restore(gs);

                // draw selected bound
                this.drawSelectedBound(g);
            }
        }
Пример #25
0
        public bool isUsingImage(string img)
        {
            // check document properties
            if (prevSceneButton.Equals(img) || nextSceneButton.Equals(img))
            {
                return(true);
            }
            if (avatarDefault.Equals(img) || avatarFrame.Equals(img) || avatarMask.Equals(img))
            {
                return(true);
            }

            // check scenes
            for (int i = 0; i < sceneManager.sceneCount(); i++)
            {
                TScene scene = sceneManager.scene(i);
                if (scene.isUsingImage(img))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #26
0
        private List <TActor> extraActorsOfEmulator(TScene scene)
        {
            // result
            List <TActor> extras = new List <TActor>();

            // back navigation button
            if (scene.prevButtonVisible && imgPrevButton != null)
            {
                TImageActor btnPrev = new TImageActor(document, imgPrevButton, 0, Program.BOOK_HEIGHT, scene, "[emulator_actor]:prev_button");
                btnPrev.anchor = new PointF(0, 1);
                extras.Add(btnPrev);

                if (document.navigationLeftButtonRender)
                {
                    TAnimation animation = new TAnimation(btnPrev);
                    TSequence  sequence  = animation.addSequence();
                    sequence.addAction(new TActionIntervalDelay()
                    {
                        duration = document.navigationButtonDelayTime * 1000
                    });
                    sequence.addAction(new TActionInstantDispatchEvent()
                    {
                        actor = btnPrev.name, eventu = Program.DEFAULT_EVENT_UNDEFINED, recursive = false
                    });
                    animation.eventu = Program.DEFAULT_EVENT_ENTER;
                    animation.start();
                    btnPrev.animations.Add(animation);

                    animation = new TAnimation(btnPrev);
                    sequence  = animation.addSequence();
                    sequence.addAction(new TActionIntervalDelay()
                    {
                        duration = 500
                    });
                    sequence.addAction(new TActionIntervalScale()
                    {
                        duration = 300, scale = new SizeF(1.4f, 1.4f)
                    });
                    sequence.addAction(new TActionIntervalScale()
                    {
                        duration = 300, scale = new SizeF(1f, 1f)
                    });
                    sequence.repeat  = 100;
                    animation.eventu = Program.DEFAULT_EVENT_UNDEFINED;
                    btnPrev.animations.Add(animation);
                }
                else
                {
                    TAnimation animation = TAnimation.newAnimation(btnPrev, new TActionInstantGoScene()
                    {
                        type = TActionInstantGoScene.ActionType.PREVIOUS
                    });
                    animation.eventu = Program.DEFAULT_EVENT_TOUCH;
                    btnPrev.animations.Add(animation);
                }
            }

            // next navigation button
            if (scene.nextButtonVisible && imgNextButton != null)
            {
                TImageActor btnNext = new TImageActor(document, imgNextButton, Program.BOOK_WIDTH, Program.BOOK_HEIGHT, scene, "[emulator_actor]:next_button");
                btnNext.anchor = new PointF(1, 1);
                extras.Add(btnNext);

                if (document.navigationRightButtonRender)
                {
                    TAnimation animation = new TAnimation(btnNext);
                    TSequence  sequence  = animation.addSequence();
                    sequence.addAction(new TActionIntervalDelay()
                    {
                        duration = document.navigationButtonDelayTime * 1000
                    });
                    sequence.addAction(new TActionInstantDispatchEvent()
                    {
                        actor = btnNext.name, eventu = Program.DEFAULT_EVENT_UNDEFINED, recursive = false
                    });
                    animation.eventu = Program.DEFAULT_EVENT_ENTER;
                    animation.start();
                    btnNext.animations.Add(animation);

                    animation = new TAnimation(btnNext);
                    sequence  = animation.addSequence();
                    sequence.addAction(new TActionIntervalDelay()
                    {
                        duration = 500
                    });
                    sequence.addAction(new TActionIntervalScale()
                    {
                        duration = 300, scale = new SizeF(1.4f, 1.4f)
                    });
                    sequence.addAction(new TActionIntervalScale()
                    {
                        duration = 300, scale = new SizeF(1f, 1f)
                    });
                    sequence.repeat  = 100;
                    animation.eventu = Program.DEFAULT_EVENT_UNDEFINED;
                    btnNext.animations.Add(animation);
                }
                else
                {
                    TAnimation animation = TAnimation.newAnimation(btnNext, new TActionInstantGoScene()
                    {
                        type = TActionInstantGoScene.ActionType.NEXT
                    });
                    animation.eventu = Program.DEFAULT_EVENT_TOUCH;
                    btnNext.animations.Add(animation);
                }
            }

            // menu button
            {
                TImageActor btnMenu = new TImageActor(document, Properties.Resources.emulator_img_menu_button, Program.BOOK_WIDTH, 0, scene, "[emulator_actor]:menu_button");
                btnMenu.anchor = new PointF(1, 0);
                extras.Add(btnMenu);

                TAnimation animation = TAnimation.newAnimation(btnMenu, new TActionInstantDispatchEvent()
                {
                    actor = "[emulator_actor]:menu_dialog", eventu = "[emulator_event]:show_dialog", recursive = true
                });
                animation.eventu = Program.DEFAULT_EVENT_TOUCH;
                btnMenu.animations.Add(animation);
            }

            // menu popup
            {
                // background
                TImageActor dlgMenu = new TImageActor(document, Properties.Resources.emulator_img_menu_dialog_bg, 0, 0, scene, "[emulator_actor]:menu_dialog");
                {
                    dlgMenu.anchor = new PointF(0, 0);
                    dlgMenu.alpha  = 0;
                    extras.Add(dlgMenu);

                    // show dialog
                    TAnimation animShow = new TAnimation(dlgMenu);
                    TSequence  seqShow  = animShow.addSequence();
                    seqShow.addAction(new TActionIntervalFade()
                    {
                        duration = 100, type = TActionIntervalFade.ActionType.IN
                    });
                    animShow.eventu = "[emulator_event]:show_dialog";
                    dlgMenu.animations.Add(animShow);

                    // hide dialog
                    TAnimation animHide = new TAnimation(dlgMenu);
                    TSequence  seqHide  = animHide.addSequence();
                    seqHide.addAction(new TActionIntervalDelay()
                    {
                        duration = 200
                    });
                    seqHide.addAction(new TActionIntervalFade()
                    {
                        duration = 100, type = TActionIntervalFade.ActionType.OUT
                    });
                    animHide.eventu = "[emulator_event]:hide_dialog";
                    dlgMenu.animations.Add(animHide);

                    TAnimation animation = TAnimation.newAnimation(dlgMenu, new TActionInstantDispatchEvent()
                    {
                        actor = "[emulator_actor]:menu_dialog", eventu = "[emulator_event]:hide_dialog", recursive = true
                    });
                    animation.eventu = Program.DEFAULT_EVENT_TOUCH;
                    dlgMenu.animations.Add(animation);
                }

                TAnimation animShowBase = TAnimation.newAnimation(null, new TActionIntervalMove()
                {
                    duration   = 300,
                    easingMode = TEasingFunction.EasingMode.Out,
                    easingType = TEasingFunction.EasingType.Bounce
                });
                animShowBase.eventu = "[emulator_event]:show_dialog";

                TAnimation animHideBase = TAnimation.newAnimation(null, new TActionIntervalMove()
                {
                    duration   = 300,
                    easingMode = TEasingFunction.EasingMode.In,
                    easingType = TEasingFunction.EasingType.Back
                });
                animHideBase.eventu = "[emulator_event]:hide_dialog";

                TImageActor btnBGM = new TImageActor(document, Properties.Resources.emulator_img_bgm_off, -100, 290, dlgMenu, "[emulator_actor]:menu_bgm_button");
                {
                    btnBGM.anchor = new PointF(0.5f, 0.5f);
                    dlgMenu.childs.Add(btnBGM);

                    // show animation from base show animation
                    TAnimation animShow = animShowBase.clone();
                    animShow.layer = btnBGM;
                    ((TActionIntervalMove)animShow.actionAtIndex(0, 0)).position = new PointF(170, 290);
                    btnBGM.animations.Add(animShow);

                    // hide animation from base hide animation
                    TAnimation animHide = animHideBase.clone();
                    animHide.layer = btnBGM;
                    ((TActionIntervalMove)animHide.actionAtIndex(0, 0)).position = btnBGM.position;
                    btnBGM.animations.Add(animHide);

                    // initialize button status, when menu is popuped
                    TAnimation animInit = TAnimation.newAnimation(btnBGM, new TActionRuntime(0, delegate(float percent)
                    {
                        if (bgmOn)
                        {
                            btnBGM.loadImage(Properties.Resources.emulator_img_bgm_on);
                        }
                        else
                        {
                            btnBGM.loadImage(Properties.Resources.emulator_img_bgm_off);
                        }
                    }));
                    animInit.eventu = "[emulator_event]:show_dialog";
                    btnBGM.animations.Add(animInit);

                    // perform action of button and change status when button is clicked
                    TAnimation animToggle = TAnimation.newAnimation(btnBGM, new TActionRuntime(0, delegate(float percent)
                    {
                        toggleBGM();

                        if (bgmOn)
                        {
                            btnBGM.loadImage(Properties.Resources.emulator_img_bgm_on);
                        }
                        else
                        {
                            btnBGM.loadImage(Properties.Resources.emulator_img_bgm_off);
                        }
                    }));
                    animToggle.eventu = Program.DEFAULT_EVENT_TOUCH;
                    btnBGM.animations.Add(animToggle);
                }

                TImageActor btnEffect = new TImageActor(document, Properties.Resources.emulator_img_effect_off, -100, 480, dlgMenu, "[emulator_actor]:menu_effect_button");
                {
                    btnEffect.anchor = new PointF(0.5f, 0.5f);
                    dlgMenu.childs.Add(btnEffect);

                    // show animation from base show animation
                    TAnimation animShow = animShowBase.clone();
                    animShow.layer = btnEffect;
                    ((TActionIntervalMove)animShow.actionAtIndex(0, 0)).position = new PointF(170, 480);
                    btnEffect.animations.Add(animShow);

                    // hide animation from base hide animation
                    TAnimation animHide = animHideBase.clone();
                    animHide.layer = btnEffect;
                    ((TActionIntervalMove)animHide.actionAtIndex(0, 0)).position = btnEffect.position;
                    btnEffect.animations.Add(animHide);

                    // initialize button status, when menu is popuped
                    TAnimation animInit = TAnimation.newAnimation(btnEffect, new TActionRuntime(0, delegate(float percent) {
                        if (effectOn)
                        {
                            btnEffect.loadImage(Properties.Resources.emulator_img_effect_on);
                        }
                        else
                        {
                            btnEffect.loadImage(Properties.Resources.emulator_img_effect_off);
                        }
                    }));
                    animInit.eventu = "[emulator_event]:show_dialog";
                    btnEffect.animations.Add(animInit);

                    // perform action of button and change status when button is clicked
                    TAnimation animToggle = TAnimation.newAnimation(btnEffect, new TActionRuntime(0, delegate(float percent) {
                        toggleEffect();

                        if (effectOn)
                        {
                            btnEffect.loadImage(Properties.Resources.emulator_img_effect_on);
                        }
                        else
                        {
                            btnEffect.loadImage(Properties.Resources.emulator_img_effect_off);
                        }
                    }));
                    animToggle.eventu = Program.DEFAULT_EVENT_TOUCH;
                    btnEffect.animations.Add(animToggle);
                }

                TImageActor btnVoice = new TImageActor(document, Properties.Resources.emulator_img_voice_off, -100, 600, dlgMenu, "[emulator_actor]:menu_voice_button");
                {
                    btnVoice.anchor = new PointF(0.5f, 0.5f);
                    dlgMenu.childs.Add(btnVoice);

                    // show animation from base show animation
                    TAnimation animShow = animShowBase.clone();
                    animShow.layer = btnVoice;
                    ((TActionIntervalMove)animShow.actionAtIndex(0, 0)).position = new PointF(170, 670);
                    btnVoice.animations.Add(animShow);

                    // hide animation from base hide animation
                    TAnimation animHide = animHideBase.clone();
                    animHide.layer = btnVoice;
                    ((TActionIntervalMove)animHide.actionAtIndex(0, 0)).position = btnVoice.position;
                    btnVoice.animations.Add(animHide);

                    // initialize button status, when menu is popuped
                    TAnimation animInit = TAnimation.newAnimation(btnVoice, new TActionRuntime(0, delegate(float percent) {
                        if (voiceOn)
                        {
                            btnVoice.loadImage(Properties.Resources.emulator_img_voice_on);
                        }
                        else
                        {
                            btnVoice.loadImage(Properties.Resources.emulator_img_voice_off);
                        }
                    }));
                    animInit.eventu = "[emulator_event]:show_dialog";
                    btnVoice.animations.Add(animInit);

                    // perform action of button and change status when button is clicked
                    TAnimation animToggle = TAnimation.newAnimation(btnVoice, new TActionRuntime(0, delegate(float percent) {
                        toggleVoice();

                        if (voiceOn)
                        {
                            btnVoice.loadImage(Properties.Resources.emulator_img_voice_on);
                        }
                        else
                        {
                            btnVoice.loadImage(Properties.Resources.emulator_img_voice_off);
                        }
                    }));
                    animToggle.eventu = Program.DEFAULT_EVENT_TOUCH;
                    btnVoice.animations.Add(animToggle);
                }

                TImageActor btnText = new TImageActor(document, Properties.Resources.emulator_img_text_off, -100, 100, dlgMenu, "[emulator_actor]:menu_text_button");
                {
                    btnText.anchor = new PointF(0.5f, 0.5f);
                    dlgMenu.childs.Add(btnText);

                    // show animation from base show animation
                    TAnimation animShow = animShowBase.clone();
                    animShow.layer = btnText;
                    ((TActionIntervalMove)animShow.actionAtIndex(0, 0)).position = new PointF(170, 100);
                    btnText.animations.Add(animShow);

                    // hide animation from base hide animation
                    TAnimation animHide = animHideBase.clone();
                    animHide.layer = btnText;
                    ((TActionIntervalMove)animHide.actionAtIndex(0, 0)).position = btnText.position;
                    btnText.animations.Add(animHide);

                    // initialize button status, when menu is popuped
                    TAnimation animInit = TAnimation.newAnimation(btnText, new TActionRuntime(0, delegate(float percent) {
                        if (textOn)
                        {
                            btnText.loadImage(Properties.Resources.emulator_img_text_on);
                        }
                        else
                        {
                            btnText.loadImage(Properties.Resources.emulator_img_text_off);
                        }
                    }));
                    animInit.eventu = "[emulator_event]:show_dialog";
                    btnText.animations.Add(animInit);

                    // perform action of button and change status when button is clicked
                    TAnimation animToggle = TAnimation.newAnimation(btnText, new TActionRuntime(0, delegate(float percent) {
                        toggleText();

                        if (textOn)
                        {
                            btnText.loadImage(Properties.Resources.emulator_img_text_on);
                        }
                        else
                        {
                            btnText.loadImage(Properties.Resources.emulator_img_text_off);
                        }
                    }));
                    animToggle.eventu = Program.DEFAULT_EVENT_TOUCH;
                    btnText.animations.Add(animToggle);
                }

                /*
                 * TImageActor btnBack = new TImageActor(document, Properties.Resources.emulator_img_menu_dialog_bg, 0, 0, dlgMenu, "[emulator_actor]:menu_back_button");
                 * {
                 *  btnBack.anchor = new PointF(1.0f, 0f);
                 *  dlgMenu.childs.Add(btnBack);
                 *
                 *  // show animation from base show animation
                 *  TAnimation animShow = animShowBase.clone();
                 *  animShow.layer = btnBack;
                 *  ((TActionIntervalMove)animShow.actionAtIndex(0, 0)).position = new PointF(900, 500);
                 *  btnBack.animations.Add(animShow);
                 *
                 *  // hide animation from base hide animation
                 *  TAnimation animHide = animHideBase.clone();
                 *  animHide.layer = btnBack;
                 *  ((TActionIntervalMove)animHide.actionAtIndex(0, 0)).position = btnBack.position;
                 *  btnBack.animations.Add(animHide);
                 *
                 *  TAnimation animation = TAnimation.newAnimation(btnBack, new TActionInstantDispatchEvent() { actor = "[emulator_actor]:menu_dialog", eventu = "[emulator_event]:hide_dialog", recursive = true });
                 *  animation.eventu = Program.DEFAULT_EVENT_TOUCH;
                 *  btnBack.animations.Add(animation);
                 * }
                 */
            }

            return(extras);
        }
 public AddSceneAction(TDocument doc, FrmMainContainer mainForm, TScene scene)
 {
     this.document = doc;
     this.mainForm = mainForm;
     this.scene    = scene;
 }