Beispiel #1
0
        private void pnlDisplayBox_MouseDown(object sender, MouseEventArgs e)
        {
            if (currentScene == null)
            {
                return;
            }

            if (e.Button == MouseButtons.Left && transitionDelegate == null)
            {
                // matrix
                Matrix mat = matrixOfEmulator();

                // set flag that mouse is pressed and store position
                MousePressed = true;
                MouseDownPos = new PointF(e.X, e.Y);

                // target item
                TActor selectedActor = currentScene.actorAtPosition(mat, e.Location, true);
                if (selectedActor != null)
                {
                    // fire touch event
                    MouseDownActor = selectedActor;
                    MouseDownActor.fireEvent(Program.DEFAULT_EVENT_TOUCH, false);

                    // fire drag event
                    if (MouseDownActor.draggable || MouseDownActor.puzzle)
                    {
                        MouseDownActor.createBackup();
                    }
                }

                // redraw workspace
                this.pnlDisplayBox.Refresh();
            }
        }
Beispiel #2
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            TActor targetActor = (TActor)emulator.currentScene.findLayer(actor);

            if (targetActor != null)
            {
                targetActor.fireEvent(eventu, recursive);
            }

            return(base.step(emulator, time));
        }