Exemple #1
0
        private void DrawCircleBumperNormal(DevicePanel d, Methods.Drawing.ObjectDrawing.EditorAnimation Animation, int x, int y, int Transparency, int amplitudeX, int amplitudeY, int angle)
        {
            if ((amplitudeX != 0 || amplitudeY != 0))
            {
                double xd        = x;
                double yd        = y;
                double x2        = x + amplitudeX - amplitudeX / 3.7;
                double y2        = y + amplitudeY - amplitudeY / 3.7;
                double radius    = Math.Pow(x2 - xd, 2) + Math.Pow(y2 - yd, 2);
                int    radiusInt = (int)Math.Sqrt(radius);
                int    newX      = (int)(radiusInt * Math.Cos(Math.PI * angle / 128));
                int    newY      = (int)(radiusInt * Math.Sin(Math.PI * angle / 128));

                d.DrawLine(x, y, x + newX, y - newY, System.Drawing.Color.Yellow, 3);
                d.DrawEllipse(x, y, amplitudeX, amplitudeY, System.Drawing.Color.White, 2);

                DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, (x + newX), (y - newY), Transparency);
            }
            else
            {
                DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency);
            }
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            bool fliph = false;
            bool flipv = false;

            int orientation = (int)e.attributesMap["orientation"].ValueUInt8;
            int animID      = 0;

            switch (orientation)
            {
            case 1:
                animID = 1;
                break;

            case 2:
                flipv = true;
                break;

            case 3:
                fliph  = true;
                animID = 1;
                break;
            }

            var Animation = LoadAnimation("HCZ/Spear.bin", d, animID, 1);

            DrawTexture(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x + (fliph ? -Animation.RequestedFrame.PivotX - Animation.RequestedFrame.Width : Animation.RequestedFrame.PivotX), y + (flipv ? -Animation.RequestedFrame.PivotY - Animation.RequestedFrame.Height : Animation.RequestedFrame.PivotY), Transparency, fliph, flipv);
            Animation = LoadAnimation("HCZ/Spear.bin", d, animID, 0);
            DrawTexture(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x + (fliph ? -Animation.RequestedFrame.PivotX - Animation.RequestedFrame.Width : Animation.RequestedFrame.PivotX), y + (flipv ? -Animation.RequestedFrame.PivotY - Animation.RequestedFrame.Height : Animation.RequestedFrame.PivotY), Transparency, fliph, flipv);
        }
Exemple #3
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int type    = (int)entity.attributesMap["type"].ValueUInt8;
            int frameID = 0;

            switch (type)
            {
            case 0:
                frameID = 0;
                break;

            case 1:
                frameID = 1;
                break;

            case 2:
                frameID = 2;
                break;

            case 3:
                frameID = 3;
                break;
            }
            bool fliph      = false;
            bool flipv      = false;
            var  editorAnim = e.LoadAnimation2("Newspaper", d, 1, frameID, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[e.index];

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            bool fliph = false;
            bool flipv = false;

            var value = e.attributesMap["length"].ValueUInt16 + 1;

            bool wEven = false;

            for (int xx = 0; xx <= value; ++xx)
            {
                int pos_x = x + (wEven ? -4 : -8) + (-value / 2 + xx) * 8;
                int pos_y = y + -4;
                if (xx == 0)
                {
                    var Animation = LoadAnimation("SPZ1/TVPole.bin", d, 1, 0);
                    DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, pos_x, pos_y, Transparency, false, false);
                }
                else if (xx == value)
                {
                    var Animation = LoadAnimation("SPZ1/TVPole.bin", d, 1, 2);
                    DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, pos_x, pos_y, Transparency, false, false);
                }
                else
                {
                    var Animation = LoadAnimation("SPZ1/TVPole.bin", d, 1, 1);
                    DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, pos_x, pos_y, Transparency, false, false);
                }
            }
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            Classes.Scene.EditorEntity e = Properties.EditorObject;
            DevicePanel d            = Properties.Graphics;
            int         x            = Properties.DrawX;
            int         y            = Properties.DrawY;
            int         Transparency = Properties.Transparency;
            int         direction    = (int)e.attributesMap["direction"].ValueUInt8;
            bool        fliph        = false;
            bool        flipv        = false;

            switch (direction)
            {
            case 0:
                break;

            case 1:
                flipv = true;
                break;

                /*case 2:
                 *  fliph = true;
                 *  break;
                 * case 3:
                 *  flipv = true;
                 *  fliph = true;
                 *  break;
                 */
            }

            var Animation = LoadAnimation(GetSetupAnimation(), d, 0, 0);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);

            Animation = LoadAnimation(GetSetupAnimation(), d, 1, 0);
            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y + (flipv ? 45 : 0), Transparency, fliph, flipv);
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            bool fliph = false;
            bool flipv = false;

            int direction = (int)e.attributesMap["direction"].ValueUInt8;

            switch (direction)
            {
            case 0:
                break;

            case 1:
                fliph = true;
                break;

            case 2:
                flipv = true;
                break;

            case 3:
                fliph = true;
                flipv = true;
                break;
            }

            var Animation = LoadAnimation("PSZ1/PSZLauncher.bin", d, 1, 0);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  direction = (int)entity.attributesMap["direction"].ValueUInt8;
            bool fliph     = false;
            bool flipv     = false;

            switch (direction)
            {
            case 0:
                break;

            case 1:
                fliph = true;
                break;

            case 2:
                flipv = true;
                break;

            case 3:
                fliph = true;
                flipv = true;
                break;
            }
            var editorAnim = e.LoadAnimation2("PSZLauncher", d, 0, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[e.index];

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            bool fliph = false;
            bool flipv = false;

            int type = (int)e.attributesMap["type"].ValueUInt8;

            var Animation = LoadAnimation("FBZ/Tuesday.bin", d, 2, 0);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);

            if (type == 0)
            {
                Animation = LoadAnimation("FBZ/Tuesday.bin", d, 0, 0);
                DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);
            }
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            bool fliph = false;
            bool flipv = false;



            int direction = (int)e.attributesMap["direction"].ValueUInt8;

            if (direction == 1)
            {
                fliph = true;
            }

            var Animation = LoadAnimation("MSZ/Pistol.bin", d, 0, 1);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x - (fliph ? 76 : 0), y, Transparency, fliph, flipv);

            Animation = LoadAnimation("MSZ/Pistol.bin", d, 0, 0);
            int width = Animation.RequestedFrame.Width;

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);

            Animation = LoadAnimation("MSZ/Pistol.bin", d, 4, 0);
            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x - (fliph ? 59 : 0), y, Transparency, fliph, flipv);

            Animation = LoadAnimation("MSZ/Pistol.bin", d, 6, 0);
            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x - (fliph ? width + 4 : 0), y, Transparency, fliph, flipv);
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            bool fliph = false;
            bool flipv = false;
            var editorAnim = e.LoadAnimation2("ControlPanel", d, 0, -1, fliph, flipv, false);
            var editorAnim2 = e.LoadAnimation2("ControlPanel", d, 1, -1, fliph, flipv, false);
            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[0];
                var frame2 = editorAnim2.Frames[e.index];

                e.ProcessAnimation(frame2.Entry.FrameSpeed, frame2.Entry.Frames.Count, frame2.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                    x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                    y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                    frame.Frame.Width, frame.Frame.Height, false, Transparency);

                d.DrawBitmap(frame2.Texture,
                    x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0),
                    y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0),
                    frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
            }
        }
Exemple #11
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  direction = (int)entity.attributesMap["direction"].ValueUInt8;
            bool fliph     = false;
            bool flipv     = false;

            if (direction == 1)
            {
                fliph = true;
            }
            var editorAnim = e.LoadAnimation2("Platform", d, 1, 4, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[0];

                e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX,
                             y + frame.Frame.CenterY,
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
            }
        }
        private void DrawStandardMovingPlatform(DevicePanel d, int x, int y, int Transparency, int amplitudeX, int amplitudeY, int angle, bool hasTension, int AttributeFrameID, Func <DevicePanel, int, int, int, System.Drawing.Color, bool> DrawCall = null)
        {
            string AnimName  = GetSetupAnimation();
            var    Animation = LoadAnimation(AnimName, d);

            if (LastFrameIDAttribute != AttributeFrameID)
            {
                UpdateRealAttributeFrameID(Animation, AttributeFrameID);
            }
            d.DrawLine(x - amplitudeX, y - amplitudeY, x + amplitudeX, y + amplitudeY, System.Drawing.Color.Yellow, 3);
            if (DrawCall != null)
            {
                DrawCall(d, x, y, Transparency, System.Drawing.Color.FromArgb(255, 255, 255, 255));
            }
            else
            {
                if (AttributeFrameID <= -1)
                {
                    return;
                }
                DrawTexturePivotNormal(d, Animation, RealAnimID, RealFrameID, x, y, Transparency);
                //DrawHitbox(d, Animation, "Solid", System.Drawing.Color.FromArgb(128, 0, 255, 0), RealAnimID, RealFrameID, x, y, Transparency, false, false, 0);
            }
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            int  aniID   = (int)e.attributesMap["aniID"].ValueEnum;
            int  frameID = (int)e.attributesMap["frameID"].ValueEnum;
            bool fliph   = false;
            bool flipv   = false;

            int zoneID = (int)e.attributesMap["zoneID"].ValueEnum;

            var Animation = LoadAnimation("EditorUIRender", d, 4, 1);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x + 3, y, Transparency, fliph, flipv);
            Animation = LoadAnimation("UI/SaveSelect.bin", d, 17, zoneID);
            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);
            Animation = LoadAnimation("EditorUIRender", d, 4, 0);
            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x + 3, y, Transparency, fliph, flipv);
        }
Exemple #14
0
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            bool fliph = false;
            bool flipv = false;

            var Animation = LoadAnimation("MSZ/Cactula.bin", d, 0, 0);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);

            var Animation2 = LoadAnimation("MSZ/Cactula.bin", d, 0, 1);

            DrawTexturePivotNormal(d, Animation2, Animation2.RequestedAnimID, Animation2.RequestedFrameID, x, y, Transparency, fliph, flipv);

            var Animation3 = LoadAnimation("MSZ/Cactula.bin", d, 1, 5);

            DrawTexturePivotNormal(d, Animation3, Animation3.RequestedAnimID, Animation3.RequestedFrameID, x, y, Transparency, fliph, flipv);
        }
Exemple #15
0
        private void DrawCircleBumperAlt(DevicePanel d, Methods.Drawing.ObjectDrawing.EditorAnimation Animation, int x, int y, int Transparency, int amplitudeX, int amplitudeY, int angle)
        {
            int[] position = new int[2] {
                0, 0
            };
            int posX = amplitudeX;
            int posY = amplitudeY;

            //Negative Values only work atm
            if (amplitudeX <= -1)
            {
                posX = -posX;
            }
            if (amplitudeY <= -1)
            {
                posY = -posY;
            }

            position = new int[2] {
                posX, posY
            };

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, (x + position[0]), (y - position[0]), Transparency);
        }
Exemple #16
0
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            bool fliph = false;
            bool flipv = false;

            int id = (int)e.attributesMap["type"].ValueEnum;

            if (id > 2)
            {
                e.attributesMap["type"].ValueEnum = 2;
            }


            var Animation = LoadAnimation("SpecialUFO/Items.bin", d, 0, id);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            //int type = (int)entity.attributesMap["type"].ValueUInt8;
            int  size        = (int)entity.attributesMap["size"].ValueVar;
            bool fliph       = false;
            bool flipv       = false;
            var  editorAnim  = e.LoadAnimation2("DirectorChair", d, 1, 0, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("DirectorChair", d, 1, 1, fliph, flipv, false);
            var  editorAnim3 = e.LoadAnimation2("DirectorChair", d, 1, 2, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0 && editorAnim3 != null && editorAnim3.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[e.index];
                var frame2 = editorAnim2.Frames[e.index];
                var frame3 = editorAnim3.Frames[e.index];

                e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y - (size * 5 + 8) + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0),
                             y - (size * 5 + 8) + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0),
                             frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
                d.DrawBitmap(frame3.Texture,
                             x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0),
                             y - (size * 5 + 8) + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim3.Frames[0].Frame.Height) : 0),
                             frame3.Frame.Width, frame3.Frame.Height, false, Transparency);
            }
        }
Exemple #18
0
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity entity = Properties.EditorObject;

            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            int  direction = (int)entity.attributesMap["direction"].ValueUInt8;
            bool fliph     = false;
            bool flipv     = false;


            var Animation = LoadAnimation(GetSetupAnimation(), d, 2, 4);

            if (direction == 1)
            {
                fliph = true;
                x    -= Animation.RequestedFrame.Width;
            }
            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x, y, Transparency, fliph, flipv);
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            var width      = (int)(entity.attributesMap["width"].ValueUInt32) - 1;
            var height     = (int)(entity.attributesMap["height"].ValueUInt32) - 1;
            var editorAnim = e.LoadAnimation2("PlaneSwitch", d, 0, 0, false, false, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0)
            {
                var frame = editorAnim.Frames[e.index];
                e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);
                bool wEven = width % 2 == 0;
                bool hEven = height % 2 == 0;
                for (int xx = 0; xx <= width; ++xx)
                {
                    for (int yy = 0; yy <= height; ++yy)
                    {
                        d.DrawBitmap(frame.Texture,
                                     x + (wEven ? frame.Frame.CenterX : -frame.Frame.Width) + (-width / 2 + xx) * frame.Frame.Width,
                                     y + (hEven ? frame.Frame.CenterY : -frame.Frame.Height) + (-height / 2 + yy) * frame.Frame.Height,
                                     frame.Frame.Width, frame.Frame.Height, false, Transparency);
                    }
                }
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            bool fliph       = false;
            bool flipv       = false;
            var  editorAnim  = e.LoadAnimation2("WeatherMobile", d, 0, 0, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("WeatherMobile", d, 0, 1, fliph, flipv, false);
            var  editorAnim3 = e.LoadAnimation2("WeatherMobile", d, 0, 2, fliph, flipv, false);
            var  editorAnim4 = e.LoadAnimation2("WeatherMobile", d, 0, 3, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0 && editorAnim3 != null && editorAnim3.Frames.Count != 0 && editorAnim4 != null && editorAnim4.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[0];
                var frame2 = editorAnim2.Frames[0];
                var frame3 = editorAnim3.Frames[0];
                var frame4 = editorAnim4.Frames[0];

                //e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y - SEPERATE_VALUE + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);
                d.DrawBitmap(frame4.Texture,
                             x + frame4.Frame.CenterX - (fliph ? (frame4.Frame.Width - editorAnim4.Frames[0].Frame.Width) : 0),
                             y - SEPERATE_VALUE + frame4.Frame.CenterY + (flipv ? (frame4.Frame.Height - editorAnim4.Frames[0].Frame.Height) : 0),
                             frame4.Frame.Width, frame4.Frame.Height, false, Transparency);
                d.DrawBitmap(frame2.Texture,
                             x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y - SEPERATE_VALUE + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame2.Frame.Width, frame.Frame.Height, false, 100);
                d.DrawBitmap(frame3.Texture,
                             x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0),
                             y - SEPERATE_VALUE + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim3.Frames[0].Frame.Height) : 0),
                             frame3.Frame.Width, frame3.Frame.Height, false, 100);
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            //int type = (int)entity.attributesMap["type"].ValueUInt8;
            //int direction = (int)entity.attributesMap["direction"].ValueUInt8;
            bool fliph       = false;
            bool flipv       = false;
            var  editorAnim  = e.LoadAnimation2("RockemSockem", d, 0, -1, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("RockemSockem", d, 1, -1, fliph, flipv, false);
            var  editorAnim3 = e.LoadAnimation2("RockemSockem", d, 2, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0 && editorAnim3 != null && editorAnim3.Frames.Count != 0)
            {
                var frame  = editorAnim.Frames[0];
                var frame2 = editorAnim2.Frames[0];
                var frame3 = editorAnim3.Frames[e.index];

                e.ProcessAnimation(frame3.Entry.FrameSpeed, frame3.Entry.Frames.Count, frame3.Frame.Duration);

                d.DrawBitmap(frame.Texture,
                             x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0),
                             y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0),
                             frame.Frame.Width, frame.Frame.Height, false, Transparency);

                for (int i = 0; i < 6; i++)
                {
                    d.DrawBitmap(frame2.Texture,
                                 x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0),
                                 y - 8 - (i * 4) + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0),
                                 frame2.Frame.Width, frame2.Frame.Height, false, Transparency);
                }
                d.DrawBitmap(frame3.Texture,
                             x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0),
                             y - 44 + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim3.Frames[0].Frame.Height) : 0),
                             frame3.Frame.Width, frame3.Frame.Height, false, Transparency);
            }
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            int type     = (int)(e.attributesMap["type"].ValueUInt8);
            int rotation = (int)(e.attributesMap["rotation"].ValueInt32 / 1.42);
            int pageID   = GetRotationFrame(rotation);

            bool fliph = FlippedH(rotation);
            bool flipv = FlippedV(rotation);



            var Animation = LoadAnimation(GetSetupAnimation(), d, 1, 0);
            int OffsetX   = (fliph ? -4 : 4);
            int OffsetY   = (flipv ? 4 : -4);

            DrawTexturePivotNormal(d, Animation, Animation.RequestedAnimID, Animation.RequestedFrameID, x + OffsetX, y + OffsetY, Transparency, fliph, flipv, rotation);
        }
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            var type         = e.attributesMap["type"].ValueEnum;
            var widthPixels  = (int)(e.attributesMap["size"].ValueVector2.X.High);
            var heightPixels = (int)(e.attributesMap["size"].ValueVector2.Y.High);

            if (widthPixels >= 1 && heightPixels >= 1)
            {
                int x1 = x - widthPixels / 2;
                int y1 = y - heightPixels / 2;
                int x2 = x + widthPixels / 2;
                int y2 = y + heightPixels / 2;


                DrawBounds2(d, x2, y2, x1, y1, Transparency, System.Drawing.Color.White, System.Drawing.Color.Gray);
            }
        }
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            var widthPixels  = (int)(entity.attributesMap["size"].ValuePosition.X.High);
            var heightPixels = (int)(entity.attributesMap["size"].ValuePosition.Y.High);
            var width        = (int)widthPixels / 16;
            var height       = (int)heightPixels / 16;

            var editorAnim = e.LoadAnimation2("EditorAssets", d, 0, 0, false, false, false);

            if (width != 0 && height != 0)
            {
                // draw corners
                for (int i = 0; i < 4; i++)
                {
                    bool right  = (i & 1) > 0;
                    bool bottom = (i & 2) > 0;

                    editorAnim = e.LoadAnimation2("EditorAssets", d, 0, 0, right, bottom, false);
                    if (editorAnim != null && editorAnim.Frames.Count != 0)
                    {
                        var frame = editorAnim.Frames[e.index];
                        e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);
                        d.DrawBitmap(frame.Texture,
                                     (x + widthPixels / (right ? 2 : -2)) - (right ? frame.Frame.Width : 0),
                                     (y + heightPixels / (bottom ? 2 : -2) - (bottom ? frame.Frame.Height : 0)),
                                     frame.Frame.Width, frame.Frame.Height, false, Transparency);
                    }
                }

                // draw top and bottom
                for (int i = 0; i < 2; i++)
                {
                    bool bottom = (i & 1) > 0;

                    editorAnim = e.LoadAnimation2("EditorAssets", d, 0, 1, false, bottom, false);
                    if (editorAnim != null && editorAnim.Frames.Count != 0)
                    {
                        var frame = editorAnim.Frames[e.index];
                        e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);
                        bool wEven = width % 2 == 0;
                        for (int j = 1; j < width; j++)
                        {
                            d.DrawBitmap(frame.Texture,
                                         (x + (wEven ? frame.Frame.CenterX : -frame.Frame.Width) + (-width / 2 + j) * frame.Frame.Width),
                                         (y + heightPixels / (bottom ? 2 : -2) - (bottom ? frame.Frame.Height : 0)),
                                         frame.Frame.Width, frame.Frame.Height, false, Transparency);
                        }
                    }
                }

                // draw sides
                for (int i = 0; i < 2; i++)
                {
                    bool right = (i & 1) > 0;

                    editorAnim = e.LoadAnimation2("EditorAssets", d, 0, 2, right, false, false);
                    if (editorAnim != null && editorAnim.Frames.Count != 0)
                    {
                        var frame = editorAnim.Frames[e.index];
                        e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration);
                        bool hEven = height % 2 == 0;
                        for (int j = 1; j < height; j++)
                        {
                            d.DrawBitmap(frame.Texture,
                                         (x + widthPixels / (right ? 2 : -2)) - (right ? frame.Frame.Width : 0),
                                         (y + (hEven ? frame.Frame.CenterY : -frame.Frame.Height) + (-height / 2 + j) * frame.Frame.Height),
                                         frame.Frame.Width, frame.Frame.Height, false, Transparency);
                        }
                    }
                }
            }
        }
        public static Dictionary <string, TextureExt> GetAnimationSpriteSheetTextures(DevicePanel d, string Name, Animation Animation, string SourcePath, string SourceDirectory, bool NoEncoreColors)
        {
            Dictionary <string, TextureExt> SpriteSheetTextures = new Dictionary <string, TextureExt>();

            foreach (var SpriteSheetPath in Animation.SpriteSheets)
            {
                Bitmap SpriteSheetBMP;
                string TargetFile = GetBitmapPath(Name, SpriteSheetPath);


                if (!File.Exists(TargetFile))
                {
                    SpriteSheetBMP = null;
                }
                else
                {
                    try
                    {
                        using (Stream stream = File.OpenRead(TargetFile))
                        {
                            Bitmap disposable = (Bitmap)System.Drawing.Bitmap.FromStream(stream);
                            var    colour     = disposable.Palette.Entries[0];
                            SpriteSheetBMP = disposable.Clone(new Rectangle(0, 0, disposable.Width, disposable.Height), PixelFormat.Format8bppIndexed);
                            SpriteSheetBMP = SetEncoreColors(SpriteSheetBMP, NoEncoreColors);
                            SpriteSheetBMP = RemoveColourImage(SpriteSheetBMP, colour);
                            SpriteSheetBMP = FixBitmapSize(SpriteSheetBMP);
                            disposable.Dispose();
                        }
                    }
                    catch
                    {
                        SpriteSheetBMP = null;
                    }
                }

                if (SpriteSheetBMP != null)
                {
                    SpriteSheetTextures.Add(SpriteSheetPath.Replace('/', '\\'), Methods.Drawing.TextureCreator.FromBitmap(d._device, SpriteSheetBMP));
                }
                else
                {
                    SpriteSheetTextures.Add(SpriteSheetPath.Replace('/', '\\'), null);
                }
            }

            return(SpriteSheetTextures);
        }
Exemple #26
0
 public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
 {
     //Code Goes Here
 }
Exemple #27
0
        public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency)
        {
            int  size        = (int)entity.attributesMap["size"].ValueUInt16;
            int  offTop      = (int)entity.attributesMap["offTop"].ValueVar;
            int  offBottom   = (int)entity.attributesMap["offBottom"].ValueVar;
            bool fliph       = false;
            bool flipv       = false;
            var  editorAnim  = e.LoadAnimation2("Press", d, 0, -1, fliph, flipv, false);
            var  editorAnim2 = e.LoadAnimation2("Press", d, 2, -1, fliph, flipv, false);

            if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0)
            {
                var  crankTop        = editorAnim2.Frames[0];
                var  crankHandle     = editorAnim.Frames[2];
                var  crankHolder     = editorAnim.Frames[0];
                var  frame           = editorAnim.Frames[6];
                var  platform        = editorAnim.Frames[3];
                var  platformEndCap  = editorAnim.Frames[5];
                var  platformEndCap2 = editorAnim.Frames[4];
                bool hEven           = (size % 2 == 0);

                for (int y2 = 0; y2 <= size; ++y2)
                {
                    d.DrawBitmap(frame.Texture,
                                 x + -frame.Frame.Width + (-1 / 2 + 1) * frame.Frame.Width + frame.Frame.CenterX,
                                 y + -frame.Frame.Height + (-size / 2 + y2) * frame.Frame.Height,
                                 platform.Frame.Width, platform.Frame.Height, false, Transparency);
                    if (y2 == size)
                    {
                        y2 = y2 + 2;
                        d.DrawBitmap(crankTop.Texture,
                                     x + crankTop.Frame.CenterX,
                                     y + -crankTop.Frame.Height + (-size / 2 + y2) * frame.Frame.Height,
                                     crankTop.Frame.Width, crankTop.Frame.Height, false, Transparency);
                    }
                }
                int yy = 0;

                d.DrawBitmap(platformEndCap.Texture,
                             x + platformEndCap.Frame.CenterX,
                             y + -platformEndCap.Frame.Height + (-size / 2 + yy) * frame.Frame.Height + offTop - platformEndCap.Frame.CenterY - (hEven ? 0 : 4),
                             platformEndCap.Frame.Width, platformEndCap.Frame.Height, false, Transparency);
                d.DrawBitmap(platform.Texture,
                             x + platform.Frame.CenterX,
                             y + -platform.Frame.Height + (-size / 2 + yy) * frame.Frame.Height + offTop - platform.Frame.CenterY - (hEven ? 0 : 4),
                             platform.Frame.Width, platform.Frame.Height, false, Transparency);

                d.DrawBitmap(platformEndCap2.Texture,
                             x + platformEndCap2.Frame.CenterX,
                             y + -platformEndCap2.Frame.Height + (-size / 2 + yy) * frame.Frame.Height + offBottom - platformEndCap2.Frame.CenterY - (hEven ? 0 : 4),
                             platformEndCap2.Frame.Width, platformEndCap2.Frame.Height, false, Transparency);
                d.DrawBitmap(platform.Texture,
                             x + platform.Frame.CenterX,
                             y + -platform.Frame.Height + (-size / 2 + yy) * frame.Frame.Height + offBottom - platform.Frame.CenterY - (hEven ? 0 : 4),
                             platform.Frame.Width, platform.Frame.Height, false, Transparency);

                d.DrawBitmap(crankHolder.Texture,
                             x + crankHolder.Frame.CenterX + 74,
                             y + -crankHolder.Frame.Height + (-size / 2 + yy) * frame.Frame.Height + crankHolder.Frame.CenterY + 16,
                             crankHolder.Frame.Width, crankHolder.Frame.Height, false, Transparency);
                d.DrawBitmap(crankHandle.Texture,
                             x + crankHandle.Frame.CenterX + 56,
                             y + -crankHandle.Frame.Height + (-size / 2 + yy) * frame.Frame.Height + crankHandle.Frame.CenterY,
                             crankHandle.Frame.Width, crankHandle.Frame.Height, false, Transparency);
                d.DrawBitmap(crankTop.Texture,
                             x + crankTop.Frame.CenterX,
                             y + -crankTop.Frame.Height + (-size / 2 + yy) * frame.Frame.Height + crankTop.Frame.CenterY,
                             crankTop.Frame.Width, crankTop.Frame.Height, false, Transparency);
            }
        }
Exemple #28
0
        public override void Draw(Structures.EntityRenderProp properties)
        {
            DevicePanel d = properties.Graphics;

            Classes.Scene.EditorEntity entity = properties.EditorObject;
            int    x            = properties.DrawX;
            int    y            = properties.DrawY;
            int    Transparency = properties.Transparency;
            string text         = "UI/Text" + Methods.Solution.SolutionState.Main.CurrentManiaUILanguage + ".bin";
            int    type         = (int)entity.attributesMap["type"].ValueUInt8;
            int    inputID      = (int)entity.attributesMap["inputID"].ValueUInt8;
            int    width        = 48;
            int    height       = 12;
            int    frameID      = 1;
            int    listID       = 0;

            switch (type)
            {
            case 0:
                frameID = 7;
                break;

            case 1:
                frameID = 8;
                break;

            case 2:
                frameID = 9;
                break;

            case 3:
                frameID = 10;
                break;

            case 4:
                frameID = 13;
                break;

            case 5:
                frameID = 1;
                break;

            case 6:
                frameID = 3;
                break;

            case 7:
                frameID = 11;
                break;

            case 8:
                frameID = 12;
                break;
            }
            d.DrawQuad(x - (width / 2) - height, y - (height / 2), x + (width / 2) + height, y + (height / 2), System.Drawing.Color.FromArgb(Transparency, System.Drawing.Color.Black), System.Drawing.Color.FromArgb(Transparency, System.Drawing.Color.Black), 0);

            var editorAnim = LoadAnimation(text, d, listID, frameID);

            DrawTexture(d, editorAnim, editorAnim.RequestedAnimID, editorAnim.RequestedFrameID, x, y + editorAnim.RequestedFrame.PivotY, Transparency, false, false);
            var editorAnimKey = LoadAnimation("UI/Buttons.bin", d, 1, 0);

            DrawTexture(d, editorAnimKey, editorAnimKey.RequestedAnimID, editorAnimKey.RequestedFrameID, x + editorAnimKey.RequestedFrame.PivotX - 16, y + editorAnimKey.RequestedFrame.PivotY, Transparency, false, false);
        }
Exemple #29
0
        private void DrawGHZWater(DevicePanel d, ObjectDrawing.EditorAnimation editorAnim, int x, int y, int Transparency, int animID, int type, int widthPixels, int heightPixels, int heightX, int r, int g, int b, bool Selected)
        {
            //Draw Icon
            editorAnim = LoadAnimation("EditorIcons2", d, 0, 8);
            DrawTexturePivotNormal(d, editorAnim, editorAnim.RequestedAnimID, editorAnim.RequestedFrameID, x, y, Transparency);

            if (widthPixels != 0 && heightPixels != 0)
            {
                int x1 = x + widthPixels / -2;
                int x2 = x + widthPixels / 2 - 1;
                int y1 = y + heightPixels / -2;
                int y2 = y + heightPixels / 2 - 1;

                if (Selected)
                {
                    //DrawWaterTileMap(d, x, y, x1, y1, widthPixels, heightPixels, GetWaterColors(255, r, g, b), Transparency);
                    d.DrawRectangle(x1, y1, x2, y2, GetWaterColors(255, r, g, b));
                    if (TilesNeedUpdate)
                    {
                        TilesNeedUpdate = false;
                    }
                }


                DrawBounds2(d, x2, y2, x1, y1, Transparency, SystemColors.Aqua, SystemColors.Transparent);
            }

            SystemColors GetWaterColors(int _a, int _r, int _g, int _b)
            {
                int red   = _r;
                int green = _g;
                int blue  = _b;

                if (red > 255)
                {
                    red = 255;
                }
                if (blue > 255)
                {
                    blue = 255;
                }
                if (green > 255)
                {
                    green = 255;
                }
                if (red < 0)
                {
                    red = 0;
                }
                if (blue < 0)
                {
                    blue = 0;
                }
                if (green < 0)
                {
                    green = 0;
                }

                return(SystemColors.FromArgb(_a, red, green, blue));
            }
        }
Exemple #30
0
        public override void Draw(Structures.EntityRenderProp Properties)
        {
            DevicePanel d = Properties.Graphics;

            Classes.Scene.EditorEntity e = Properties.EditorObject;
            int x            = Properties.DrawX;
            int y            = Properties.DrawY;
            int Transparency = Properties.Transparency;

            int  type         = (int)e.attributesMap["type"].ValueEnum;
            var  widthPixels  = (int)(e.attributesMap["size"].ValueVector2.X.High);
            var  heightPixels = (int)(e.attributesMap["size"].ValueVector2.Y.High);
            var  heightY      = (int)(e.attributesMap["height"].ValueVector2.Y.High);
            var  heightX      = (int)(e.attributesMap["height"].ValueVector2.X.High);
            int  r            = (int)(e.attributesMap["r"].ValueUInt8);
            int  g            = (int)(e.attributesMap["g"].ValueUInt8);
            int  b            = (int)(e.attributesMap["b"].ValueUInt8);
            var  width        = (int)widthPixels / 16;
            var  height       = (int)heightPixels / 16;
            bool fliph        = false;
            bool flipv        = false;
            bool showBounds   = false;
            bool HCZBubbles   = false;
            int  animID       = 0;

            switch (type)
            {
            case 0:
                showBounds = false;
                break;

            case 1:
                showBounds = true;
                break;

            case 2:
                showBounds = false;
                animID     = 2;
                break;

            case 3:
                showBounds = true;
                break;

            case 4:
                showBounds = true;
                break;

            case 5:
                showBounds = false;
                HCZBubbles = true;
                break;
            }


            var editorAnim = LoadAnimation("Global/Water.bin", d, animID, 0);

            // Base Water + Bubble Source
            if (animID >= 0 && (type == 2 || type == 0) && !showBounds)
            {
                DrawWaterBase(d, editorAnim, x, y, Transparency, animID, type);
            }
            // HCZ Big Bubbles
            if (type == 5)
            {
                DrawBigBubble(d, editorAnim, x, y, Transparency, animID, type);
            }
            // Bounded Water
            if (showBounds == true && HCZBubbles == false && type != 1)
            {
                DrawWaterBounds(d, editorAnim, x, y, Transparency, animID, type, widthPixels, heightPixels, heightX, r, g, b, e.Selected);
            }
            if (type == 1)
            {
                DrawGHZWater(d, editorAnim, x, y, Transparency, animID, type, widthPixels, heightPixels, heightX, r, g, b, e.Selected);
            }
        }