Example #1
0
        /// <summary>
        /// el: Picture move
        /// num "integer"
        /// duration "integer"
        /// position x:"integer" y:"integer"
        /// [Size zoom_x:"integer" zoom_y:"integer"]
        /// [opacity "0-255"]
        /// [blend_type "normaladd|sub"]
        /// [angle "0-360"]
        /// </summary>
        static void PictureMove()
        {
            GamePicture picture  = MakeCommand.Command("num").ToPicture();
            int         duration = MakeCommand.Command("duration").ToInteger();

            MakeCommand.Category("position");
            int   x          = MakeCommand.Parameter("x").ToInteger();
            int   y          = MakeCommand.Parameter("y").ToInteger();
            float zoom_x     = 100f;
            float zoom_y     = 100f;
            byte  opacity    = 255;
            int   blend_type = 0;

            if (picture != null)
            {
                zoom_x     = picture.ZoomX;
                zoom_y     = picture.ZoomY;
                opacity    = picture.Opacity;
                blend_type = picture.BlendType;
            }
            if (MakeCommand.Optional("size"))
            {
                MakeCommand.Category("size");
                zoom_x = MakeCommand.Parameter("zoom_x").ToInteger();
                zoom_y = MakeCommand.Parameter("zoom_y").ToInteger();
            }
            if (MakeCommand.Optional("blend_type"))
            {
                blend_type = MakeCommand.Command("blend_type").ToBlendType();
            }
            int angle = 0;

            if (MakeCommand.Optional("opacity"))
            {
                opacity = (byte)MakeCommand.Command("opacity").ToInteger();
            }
            if (MakeCommand.Optional("angle"))
            {
                angle = MakeCommand.Command("angle").ToInteger();
            }
            if (picture != null)
            {
                picture.Move(duration, picture.Origin, x, y, zoom_x, zoom_y, opacity, blend_type, angle);
            }
        }