public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { var value = entity.attributesMap["type"]; int direction = (int)entity.attributesMap["direction"].ValueUInt8; bool fliph = false; bool flipv = false; switch (direction) { case 0: break; case 1: flipv = true; break; default: break; } var editorAnimBox = e.LoadAnimation2("ItemBox", d, 0, 0, fliph, flipv, false); var editorAnimEffect = e.LoadAnimation2("ItemBox", d, 2, (int)value.ValueVar, fliph, flipv, false); if (editorAnimBox != null && editorAnimEffect != null && editorAnimEffect.Frames.Count != 0) { var frameBox = editorAnimBox.Frames[0]; var frameEffect = editorAnimEffect.Frames[0]; d.DrawBitmap(frameBox.Texture, x + frameBox.Frame.CenterX, y + frameBox.Frame.CenterY, frameBox.Frame.Width, frameBox.Frame.Height, false, Transparency); d.DrawBitmap(frameEffect.Texture, x + frameEffect.Frame.CenterX, y + frameEffect.Frame.CenterY - (flipv ? (-3) : 3), frameEffect.Frame.Width, frameEffect.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; int height = (int)entity.attributesMap["height"].ValueUInt8; var editorAnim = e.LoadAnimation2("TwistedTubes", d, 0, 1, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("TwistedTubes", d, 0, 0, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0) { var frame = editorAnim.Frames[e.index]; var frame2 = editorAnim2.Frames[e.index]; //ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration); 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, frame.Frame.Height, false, Transparency); for (int i = 0; i < height * 2; i++) { d.DrawBitmap(frame.Texture, x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[1].Frame.Width) : 0), y + (i * 32) + frame.Frame.CenterY + 64 + (flipv ? (frame.Frame.Height - editorAnim.Frames[1].Frame.Height) : 0), frame.Frame.Width, frame.Frame.Height, false, Transparency); } } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int type = (int)entity.attributesMap["type"].ValueVar; bool fliph = false; bool flipv = false; var editorAnim = e.LoadAnimation2("EggPrison", d, 0, -1, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("EggPrison", d, 1, -1, fliph, flipv, false); var editorAnim3 = e.LoadAnimation2("EggPrison", 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[0]; 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); d.DrawBitmap(frame3.Texture, x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0), y + 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(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int letterID = (int)entity.attributesMap["letterID"].ValueUInt8; bool controller = entity.attributesMap["controller"].ValueBool; bool fliph = false; bool flipv = false; var editorAnim = e.LoadAnimation2("Letterboard", d, 0, -1, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("Letterboard", d, 1, letterID - 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]; //ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration); if (letterID == 0 || controller == true) { 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); } else { d.DrawBitmap(frame2.Texture, x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[letterID].Frame.Width) : 0), y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[letterID].Frame.Height) : 0), frame.Frame.Width, frame.Frame.Height, false, Transparency); } } }
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; if (direction == 1) { fliph = true; } var editorAnim = e.LoadAnimation2("Grabber", d, 0, -1, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("Grabber", d, 1, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0) { var frame = editorAnim.Frames[e.index]; var frame2 = editorAnim2.Frames[e.index]; e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration); 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 - 2) : 0), y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0), frame2.Frame.Width, frame2.Frame.Height, false, Transparency); } }
public void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { bool fliph = false; bool flipv = false; var mightyAnim = e.LoadAnimation2("SchrodingersCapsule", d, 3, -1, fliph, flipv, false); var rayAnim = e.LoadAnimation2("SchrodingersCapsule", d, 4, -1, fliph, flipv, false); if (mightyAnim != null && mightyAnim.Frames.Count != 0 && rayAnim != null && rayAnim.Frames.Count != 0) { var mightyFrame = mightyAnim.Frames[e.index]; var rayFrame = rayAnim.Frames[e.index]; //e.ProcessAnimation(rayFrame.Entry.FrameSpeed, rayFrame.Entry.Frames.Count, rayFrame.Frame.Duration); //e.ProcessAnimation(mightyFrame.Entry.FrameSpeed, mightyFrame.Entry.Frames.Count, mightyFrame.Frame.Duration); d.DrawBitmap(mightyFrame.Texture, x + mightyFrame.Frame.CenterX - (fliph ? (mightyFrame.Frame.Width - mightyAnim.Frames[0].Frame.Width) : 0) + 15, y + mightyFrame.Frame.CenterY + (flipv ? (mightyFrame.Frame.Height - mightyAnim.Frames[0].Frame.Height) : 0), mightyFrame.Frame.Width, mightyFrame.Frame.Height, false, Transparency); d.DrawBitmap(rayFrame.Texture, x + rayFrame.Frame.CenterX - (fliph ? (rayFrame.Frame.Width - rayAnim.Frames[0].Frame.Width) : 0) - 15, y + rayFrame.Frame.CenterY + (flipv ? (rayFrame.Frame.Height - rayAnim.Frames[0].Frame.Height) : 0), rayFrame.Frame.Width, rayFrame.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("FBZFan", d, 0, 0, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("FBZFan", d, 1, -1, fliph, flipv, false); var editorAnim3 = e.LoadAnimation2("FBZFan", d, 2, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnim2 != null && editorAnim.Frames.Count != 0 && editorAnim3 != null && editorAnim.Frames.Count != 0) { var frame = editorAnim.Frames[0]; var frame2 = editorAnim2.Frames[e.index]; var frame3 = editorAnim3.Frames[e.index]; // e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration); e.ProcessAnimation(frame2.Entry.FrameSpeed, frame2.Entry.Frames.Count, frame2.Frame.Duration); 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 * 2) : 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 * 2) : 0), y + 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 * 2) : 0), y + 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(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { var type = entity.attributesMap["type"].ValueVar; var widthPixels = (int)(entity.attributesMap["size"].ValuePosition.X.High); var heightPixels = (int)(entity.attributesMap["size"].ValuePosition.Y.High); var width = (int)widthPixels / 16 - 1; var height = (int)heightPixels / 16 - 1; var editorAnim = e.LoadAnimation2("EditorAssets", d, 1, 1 + (int)type * 2, false, false, false); if (width != -1 && height != -1) { // draw inside // TODO this is really heavy on resources, so maybe switch to just drawing a rectangle?? for (int i = 0; i <= height; i++) { editorAnim = e.LoadAnimation2("EditorAssets", d, 1, 1 + (int)type * 2, 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 j = 0; j <= width; j++) { d.DrawBitmap(frame.Texture, (((width + 1) * 16) - widthPixels) / 2 + (x + (wEven ? frame.Frame.CenterX : -frame.Frame.Width) + (-width / 2 + j) * frame.Frame.Width), y + (hEven ? frame.Frame.CenterY : -frame.Frame.Height) + (-height / 2 + i) * frame.Frame.Height, frame.Frame.Width, frame.Frame.Height, false, Transparency); } } } // draw top and botton for (int i = 0; i < 2; i++) { bool bottom = !((i & 1) > 0); editorAnim = e.LoadAnimation2("EditorAssets", d, 1, (bottom ? 1 : 0) + (int)type * 2, 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 j = 0; j <= width; j++) { d.DrawBitmap(frame.Texture, (((width + 1) * 16) - widthPixels) / 2 + (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); } } } } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int length = (int)entity.attributesMap["length"].ValueVar; int i = 0; bool fliph = false; bool flipv = false; var editorAnim = e.LoadAnimation2("Platform", d, 3, 0, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("Platform", d, 3, 1, fliph, flipv, false); var editorAnim3 = e.LoadAnimation2("Platform", d, 3, 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[0]; var frame2 = editorAnim2.Frames[0]; var frame3 = editorAnim3.Frames[0]; int lengthMemory = length; //e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration); int repeat = 0; int lengthLeft = length; bool finalLoop = false; int spritewidth = frame2.Frame.Height; int length_y = y - length; int start_y = y - length - 4; int chain_start_y = y - length - 4 + frame.Frame.Height; while (lengthLeft > spritewidth) { repeat++; lengthLeft = lengthLeft - spritewidth; } d.DrawBitmap(frame2.Texture, x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0), chain_start_y - (i * spritewidth) + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0), frame2.Frame.Width, lengthMemory, false, Transparency); for (i = 1; i < repeat + 1; i++) { if (i == repeat) { finalLoop = true; } d.DrawBitmap(frame2.Texture, x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0), chain_start_y + (i * spritewidth) + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0), frame2.Frame.Width, (finalLoop ? lengthLeft : frame2.Frame.Height), false, Transparency); } d.DrawBitmap(frame.Texture, x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0), start_y - (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0), frame.Frame.Width, frame.Frame.Height, false, Transparency); d.DrawBitmap(frame3.Texture, x + frame3.Frame.CenterX + (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0), y + 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(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { const int LeftDist = 1, LeftPlane = 2, RightDist = 4, RightPlane = 8; var flags = (int)entity.attributesMap["flags"].ValueVar; var size = (int)(entity.attributesMap["size"].ValueVar) - 1; var angle = entity.attributesMap["angle"].ValueInt32; int frameDist = (flags & LeftDist) > 0 ? 1 : 0; int framePlane = (flags & LeftPlane) > 0 ? 2 : 0; var editorAnim = e.LoadAnimation2("PlaneSwitch", d, 0, frameDist + framePlane, false, false, false); const int pivotOffsetX = -8, pivotOffsetY = 0; const int drawOffsetX = 0, drawOffsetY = -8; 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 = size % 2 == 0; for (int yy = 0; yy <= size; ++yy) { int[] drawCoords = RotatePoints( x - frame.Frame.Width, (y + (hEven ? frame.Frame.CenterY : -frame.Frame.Height) + (-size / 2 + yy) * frame.Frame.Height), x + pivotOffsetX, y + pivotOffsetY, angle); d.DrawBitmap(frame.Texture, drawCoords[0] + drawOffsetX, drawCoords[1] + drawOffsetY, frame.Frame.Width, frame.Frame.Height, false, Transparency); } } frameDist = (flags & RightDist) > 0 ? 1 : 0; framePlane = (flags & RightPlane) > 0 ? 2 : 0; editorAnim = e.LoadAnimation2("PlaneSwitch", d, 0, frameDist + framePlane, 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 hEven = size % 2 == 0; for (int yy = 0; yy <= size; ++yy) { int[] drawCoords = RotatePoints( x, (y + (hEven ? frame.Frame.CenterY : -frame.Frame.Height) + (-size / 2 + yy) * frame.Frame.Height), x + pivotOffsetX, y + pivotOffsetY, angle); d.DrawBitmap(frame.Texture, drawCoords[0] + drawOffsetX, drawCoords[1] + drawOffsetY, frame.Frame.Width, frame.Frame.Height, false, Transparency); } } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int type = (int)entity.attributesMap["type"].ValueVar; bool fliph = false; bool flipv = false; int animID = 0; if (type == 0 || type == 1) { animID = 0; } if (type == 2 || type == 3) { animID = 1; } if (type == 3) { fliph = true; } if (type == 1) { flipv = true; } var editorAnim = e.LoadAnimation2("Button", d, animID, -1, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("Button", d, animID, 1, fliph, flipv, false); var editorAnim3 = e.LoadAnimation2("Button", d, animID, 2, fliph, flipv, false); if (editorAnim2 != null && editorAnim2.Frames.Count != 0) { var frame2 = editorAnim2.Frames[e.index]; d.DrawBitmap(frame2.Texture, x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width - 7) : 0), y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height - 7) : 0), frame2.Frame.Width, frame2.Frame.Height, false, Transparency); } if (editorAnim3 != null && editorAnim3.Frames.Count != 0) { var frame3 = editorAnim3.Frames[e.index]; d.DrawBitmap(frame3.Texture, x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width - 7) : 0), y + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim3.Frames[0].Frame.Height - 7) : 0), frame3.Frame.Width, frame3.Frame.Height, false, Transparency); } 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 + 9) : 0), y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height + 9) : 0), frame.Frame.Width, frame.Frame.Height, false, Transparency); } }
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) * 2; var heightPixels = (int)(entity.attributesMap["size"].ValuePosition.Y.High) * 2; var width = (int)widthPixels / 16; var height = (int)heightPixels / 16; //Draw Icon var editorAnim = e.LoadAnimation2("EditorIcons2", d, 0, 5, false, false, false); if (editorAnim != null && editorAnim.Frames.Count != 0) { var frame2 = editorAnim.Frames[e.index]; d.DrawBitmap(frame2.Texture, x + frame2.Frame.CenterX, y + frame2.Frame.CenterY, frame2.Frame.Width, frame2.Frame.Height, false, Transparency); editorAnim = e.LoadAnimation2("EditorAssets", d, 0, 0, false, false, false); if (width != 0 && height != 0) { int x1 = x + widthPixels / -2; int x2 = x + widthPixels / 2 - 1; int y1 = y + heightPixels / -2; int y2 = y + heightPixels / 2 - 1; d.DrawLine(x1, y1, x1, y2, SystemColors.White); d.DrawLine(x1, y1, x2, y1, SystemColors.White); d.DrawLine(x2, y2, x1, y2, SystemColors.White); d.DrawLine(x2, y2, x2, y1, SystemColors.White); // 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); } } } } }
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("EditorIcons2", d, 0, 6, fliph, flipv, false); var width = (int)(entity.attributesMap["size"].ValuePosition.X.High * 2 - 1); var height = (int)(entity.attributesMap["size"].ValuePosition.Y.High * 2 - 1); 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); } if (width != -1 && height != -1) { bool wEven = width % 2 == 0; bool hEven = height % 2 == 0; int x1 = (x + (wEven ? -8 : -16) + (-width / 2 + width) * 16) + 15; int x2 = (x + (wEven ? -8 : -16) + (-width / 2) * 16); int y1 = (y + (hEven ? -8 : -16) + (-height / 2 + height) * 16) + 15; int y2 = (y + (hEven ? -8 : -16) + (-height / 2) * 16); d.DrawLine(x1, y1, x1, y2, SystemColors.White); d.DrawLine(x1, y1, x2, y1, SystemColors.White); d.DrawLine(x2, y2, x1, y2, SystemColors.White); d.DrawLine(x2, y2, x2, y1, SystemColors.White); // 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]; d.DrawBitmap(frame.Texture, (x + (wEven ? frame.Frame.CenterX : -frame.Frame.Width) + (-width / 2 + (right ? width : 0)) * frame.Frame.Width), (y + (hEven ? frame.Frame.CenterY : -frame.Frame.Height) + (-height / 2 + (bottom ? height : 0)) * 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) { //int type = (int)entity.attributesMap["type"].ValueUInt8; //int direction = (int)entity.attributesMap["direction"].ValueUInt8; bool fliph = false; bool flipv = false; var editorAnim = e.LoadAnimation2("CaterkillerJr", d, 0, -1, true, flipv, false); var editorAnim2 = e.LoadAnimation2("CaterkillerJr", d, 1, -1, fliph, flipv, false); var editorAnim3 = e.LoadAnimation2("CaterkillerJr", d, 2, -1, fliph, flipv, false); var editorAnim4 = e.LoadAnimation2("CaterkillerJr", d, 3, -1, 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]; //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); for (int i = 0; i <= 6; i++) { if (i <= 3 && i >= 1) { d.DrawBitmap(frame2.Texture, x + frame2.Frame.CenterX + (i * frame2.Frame.Width) + (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); } if (i == 4) { d.DrawBitmap(frame3.Texture, x + frame3.Frame.CenterX + (i * frame3.Frame.Width) + (frame2.Frame.Width - 5) + (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0), y + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim3.Frames[0].Frame.Height) : 0), frame3.Frame.Width, frame3.Frame.Height, false, Transparency); } if (i >= 5) { d.DrawBitmap(frame4.Texture, x + frame4.Frame.CenterX + (i * frame4.Frame.Width) + frame2.Frame.Width + frame3.Frame.Width + (fliph ? (frame4.Frame.Width - editorAnim4.Frames[0].Frame.Width) : 0), y + frame4.Frame.CenterY + (flipv ? (frame4.Frame.Height - editorAnim4.Frames[0].Frame.Height) : 0), frame4.Frame.Width, frame4.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; int type = (int)entity.attributesMap["type"].ValueVar; int frameID = 0; if (type == 2) { frameID = 3; } if (type == 1) { frameID = 1; } var editorAnim = e.LoadAnimation2("Missile", d, frameID, -1, fliph, flipv, 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 + frame.Frame.CenterX + (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width * 2) : 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(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int letter = (int)entity.attributesMap["letter"].ValueUInt8; int duration = (int)entity.attributesMap["duration"].ValueUInt16; bool fliph = false; bool flipv = false; int frameID = 0; if (letter >= 11) { entity.attributesMap["letter"].ValueUInt8 = 11; } if (duration != 0) { frameID = 4; } var editorAnim = e.LoadAnimation2("PrintBlock", d, letter, 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(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { bool fliph = false; bool flipv = false; var editorAnim = e.LoadAnimation2("WoodChipper", d, 0, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0) { var frame = editorAnim.Frames[0]; var frame2 = editorAnim.Frames[1]; var frame3 = editorAnim.Frames[2]; var frame4 = editorAnim.Frames[6]; //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(frame2.Texture, x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim.Frames[1].Frame.Width) : 0), y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim.Frames[1].Frame.Height) : 0), frame2.Frame.Width, frame2.Frame.Height, false, Transparency); d.DrawBitmap(frame3.Texture, x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim.Frames[2].Frame.Width) : 0), y + frame3.Frame.CenterY + (flipv ? (frame3.Frame.Height - editorAnim.Frames[2].Frame.Height) : 0), frame3.Frame.Width, frame3.Frame.Height, false, Transparency); d.DrawBitmap(frame4.Texture, x + frame4.Frame.CenterX - (fliph ? (frame4.Frame.Width - editorAnim.Frames[6].Frame.Width) : 0), y + frame4.Frame.CenterY + (flipv ? (frame4.Frame.Height - editorAnim.Frames[6].Frame.Height) : 0), frame4.Frame.Width, frame4.Frame.Height, false, Transparency); } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int direction = (int)entity.attributesMap["direction"].ValueUInt8; bool hasSaw = entity.attributesMap["hasSaw"].ValueBool; bool fliph = false; bool flipv = false; int animID; if (direction == 2) { if (hasSaw) { animID = 4; } else { animID = 3; } } else if (direction == 3) { fliph = true; if (hasSaw) { animID = 4; } else { animID = 3; } } else { if (hasSaw) { animID = 1; } else { animID = 0; } } if (direction == 1) { flipv = true; } var editorAnim = e.LoadAnimation2("JuggleSaw", d, animID, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && animID >= 0) { var frame = editorAnim.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 + (hasSaw ? (38) : 16)) : 0), y + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height + (hasSaw ? (37) : 15)) : 0), frame.Frame.Width, frame.Frame.Height, false, Transparency); } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int type = (int)entity.attributesMap["type"].ValueUInt8; bool fliph = false; bool flipv = false; int animID; if (type == 1) { animID = 1; } else { animID = 0; } var editorAnim = e.LoadAnimation2("Turntable", d, animID, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && animID >= 0) { var frame = editorAnim.Frames[e.index]; e.ProcessAnimation(1, 14, 2); 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(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) { flipv = true; } var editorAnim = e.LoadAnimation2("Clucker", d, 0, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0) { var frame = editorAnim.Frames[0]; var frame2 = editorAnim.Frames[1]; var frame3 = editorAnim.Frames[2]; d.DrawBitmap(frame2.Texture, x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0), y + frame2.Frame.CenterY + (flipv ? (16) : -16), frame2.Frame.Width, frame2.Frame.Height, false, Transparency); d.DrawBitmap(frame3.Texture, x + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0), y + frame3.Frame.CenterY + (flipv ? (-4) : -16), frame3.Frame.Width, frame3.Frame.Height, false, Transparency); 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(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { var length = (short)(entity.attributesMap["length"].ValueUInt16); var orientation = entity.attributesMap["orientation"].ValueUInt8; if (orientation > 1) { orientation = 0; } var editorAnim = e.LoadAnimation2("BreakBar", d, orientation, -1, false, false, false); if (editorAnim != null && editorAnim.Frames.Count != 0) { var frameTop = editorAnim.Frames[0]; var frameBase = editorAnim.Frames[1]; var frameBottom = editorAnim.Frames[2]; for (int i = -length / 2; i <= length / 2; ++i) { d.DrawBitmap(frameBase.Texture, x + frameBase.Frame.CenterX, y + frameBase.Frame.CenterY + i * frameBase.Frame.Height, frameBase.Frame.Width, frameBase.Frame.Height, false, Transparency); } d.DrawBitmap(frameTop.Texture, x + frameTop.Frame.CenterX, y + frameTop.Frame.CenterY - (length / 2 + 1) * frameBase.Frame.Height, frameTop.Frame.Width, frameTop.Frame.Height, false, Transparency); d.DrawBitmap(frameBottom.Texture, x + frameBottom.Frame.CenterX, y + frameBottom.Frame.CenterY + (length / 2 + 1) * frameBottom.Frame.Height, frameBottom.Frame.Width, frameBottom.Frame.Height, false, Transparency); } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int angle = (int)(entity.attributesMap["angle"].ValueInt32); int length = (int)(entity.attributesMap["length"].ValueVar / 1.4); bool fliph = false; bool flipv = false; var editorAnim = e.LoadAnimation2("ZipLine", d, 0, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0) { var frame = editorAnim.Frames[e.index]; var frame2 = editorAnim.Frames[1]; 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 - editorAnim.Frames[0].Frame.Width) : 0), y + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0), frame2.Frame.Width, frame2.Frame.Height, false, Transparency); if (length != 0) { int[] processPoints = RotatePoints(x + length, y + length, x, y, -angle + 32); d.DrawLine(x, y, processPoints[0], processPoints[1], System.Drawing.Color.FromArgb(255, 49, 48, 115)); d.DrawLine(x, y - 1, processPoints[0], processPoints[1] - 1, System.Drawing.Color.FromArgb(255, 99, 97, 165)); d.DrawBitmap(frame2.Texture, processPoints[0] + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0) - 2, processPoints[1] + frame2.Frame.CenterY + (flipv ? (frame2.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0) - 1, frame2.Frame.Width, frame2.Frame.Height, false, Transparency); } } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { var width = (int)(entity.attributesMap["width"].ValueUInt8); var height = (int)(entity.attributesMap["height"].ValueUInt8); bool breakClimb = entity.attributesMap["breakClimb"].ValueBool; int type; if (breakClimb) { type = 9; } else { type = 6; } var editorAnim = e.LoadAnimation2("ItemBox", d, 2, type, 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) { int animID = (int)entity.attributesMap["type"].ValueVar; var flipFlag = entity.attributesMap["flipFlag"].ValueVar; bool fliph = false; bool flipv = false; // Handle springs being flipped in both planes // Down if ((flipFlag & 0x02) == 0x02) { flipv = true; } // Left if ((flipFlag & 0x01) == 0x01) { fliph = true; } var editorAnim = e.LoadAnimation2("IceSpring", d, animID % 3, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && animID >= 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(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { var editorAnim = e.LoadAnimation2("SignPost", d, 0, -1, false, false, false); if (editorAnim != null && editorAnim.Frames.Count != 0) { var frame = editorAnim.Frames[e.index]; e.ProcessAnimation(1, 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); } if (Properties.Settings.Default.UsePrePlusOffsets) { editorAnim = e.LoadAnimation2("SignPost", d, 4, -1, false, false, false); if (editorAnim != null && editorAnim.Frames.Count != 0) { for (int i = 0; i < editorAnim.Frames.Count; ++i) { if (i == 1) { continue; } var frame = editorAnim.Frames[i]; d.DrawBitmap(frame.Texture, x + frame.Frame.CenterX, y + frame.Frame.CenterY, frame.Frame.Width, frame.Frame.Height, false, Transparency); } } } else { editorAnim = e.LoadAnimation2("SignPost", d, 6, -1, false, false, false); if (editorAnim != null && editorAnim.Frames.Count != 0) { for (int i = 0; i < editorAnim.Frames.Count; ++i) { if (i == 1) { continue; } var frame = editorAnim.Frames[i]; d.DrawBitmap(frame.Texture, x + frame.Frame.CenterX, y + frame.Frame.CenterY, frame.Frame.Width, frame.Frame.Height, false, Transparency); } } } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int length = (int)entity.attributesMap["length"].ValueVar; int i = 0; bool fliph = false; bool flipv = false; var editorAnim = e.LoadAnimation2("HangPoint", d, 0, 0, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("HangPoint", d, 0, 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[0]; int lengthMemory = length; //e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration); int repeat = 0; int lengthLeft = length; bool finalLoop = false; while (lengthLeft > 256) { repeat++; lengthLeft = lengthLeft - 256; } d.DrawBitmap(frame2.Texture, x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0), y - (i * 256) + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0), frame2.Frame.Width, lengthMemory, false, Transparency); for (i = 1; i < repeat + 1; i++) { if (i == repeat) { finalLoop = true; } d.DrawBitmap(frame2.Texture, x + frame2.Frame.CenterX - (fliph ? (frame2.Frame.Width - editorAnim2.Frames[0].Frame.Width) : 0), y + (i * 256) + (flipv ? (frame2.Frame.Height - editorAnim2.Frames[0].Frame.Height) : 0), frame2.Frame.Width, (finalLoop ? lengthLeft : frame2.Frame.Height), false, Transparency); } d.DrawBitmap(frame.Texture, x + frame.Frame.CenterX - (fliph ? (frame.Frame.Width - editorAnim.Frames[0].Frame.Width) : 0), y + length + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0), 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("MonkeyDude", d, 0, -1, fliph, flipv, false); var editorAnimTail = e.LoadAnimation2("MonkeyDude", d, 1, -1, fliph, flipv, false); var editorAnimArm = e.LoadAnimation2("MonkeyDude", d, 2, -1, fliph, flipv, false); var editorAnimHand = e.LoadAnimation2("MonkeyDude", d, 3, -1, fliph, flipv, false); var editorAnimCoconut = e.LoadAnimation2("MonkeyDude", d, 4, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnimTail != null && editorAnimTail.Frames.Count != 0 && editorAnimArm != null && editorAnimArm.Frames.Count != 0 && editorAnimCoconut != null && editorAnimCoconut.Frames.Count != 0 && editorAnimHand != null && editorAnimHand.Frames.Count != 0) { var frame = editorAnim.Frames[e.index]; var frameTail = editorAnimTail.Frames[e.index]; var frameArm = editorAnimArm.Frames[e.index]; var frameHand = editorAnimHand.Frames[e.index]; var frameCoconut = editorAnimCoconut.Frames[e.index]; int i; for (i = 0; i < 4; i++) { d.DrawBitmap(frameArm.Texture, (x - 15) + frameArm.Frame.CenterX * i - 3, (y - 5) + frameArm.Frame.CenterY * i - 3, frameArm.Frame.Width, frameArm.Frame.Height, false, Transparency); } i++; d.DrawBitmap(frameHand.Texture, (x - 15) + frameHand.Frame.CenterX * i, (y - 5) + frameHand.Frame.CenterY * i, frameHand.Frame.Width, frameHand.Frame.Height, false, Transparency); i++; d.DrawBitmap(frameCoconut.Texture, (x - 15) + frameCoconut.Frame.CenterX * i, (y - 5) + frameCoconut.Frame.CenterY * i, frameCoconut.Frame.Width, frameCoconut.Frame.Height, false, Transparency); 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(frameTail.Texture, x + frameTail.Frame.CenterX - (fliph ? (frameTail.Frame.Width - editorAnimTail.Frames[0].Frame.Width) : 0), y + frameTail.Frame.CenterY + (flipv ? (frameTail.Frame.Height - editorAnimTail.Frames[0].Frame.Height) : 0), frameTail.Frame.Width, frameTail.Frame.Height, false, Transparency); } }
public override void Draw(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { int type = (int)entity.attributesMap["type"].ValueVar; bool fliph = false; bool flipv = false; int animID; int frameID; if (type == 2) { animID = 2; frameID = -1; } else { animID = 0; frameID = 0; } var editorAnim = e.LoadAnimation2("CableWarp", d, animID, frameID, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("PlaneSwitch", d, 0, 5, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && animID >= 0 && editorAnim2 != null && editorAnim2.Frames.Count != 0) { var frame = editorAnim.Frames[e.index]; var frame2 = editorAnim2.Frames[0]; e.ProcessAnimation(frame.Entry.FrameSpeed, frame.Entry.Frames.Count, frame.Frame.Duration); if (type != 2) { 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); } else { 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); } } }
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("FilmProjector", d, 0, 0, fliph, flipv, false); var editorAnim2 = e.LoadAnimation2("FilmProjector", d, 0, 1, fliph, flipv, false); var editorAnim4 = e.LoadAnimation2("FilmProjector", d, 1, 0, fliph, flipv, false); var editorAnim5 = e.LoadAnimation2("FilmProjector", d, 2, 0, fliph, flipv, false); var editorAnim6 = e.LoadAnimation2("FilmProjector", d, 1, 0, fliph, flipv, false); var editorAnim7 = e.LoadAnimation2("FilmProjector", d, 2, 0, fliph, flipv, false); var editorAnim3 = e.LoadAnimation2("FilmProjector", d, 3, -1, 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 && editorAnim5 != null && editorAnim5.Frames.Count != 0 && editorAnim6 != null && editorAnim6.Frames.Count != 0 && editorAnim7 != null && editorAnim7.Frames.Count != 0) { var frame = editorAnim.Frames[0]; var frame2 = editorAnim2.Frames[0]; var frame4 = editorAnim4.Frames[0]; var frame5 = editorAnim5.Frames[0]; var frame6 = editorAnim4.Frames[0]; var frame7 = editorAnim5.Frames[0]; var frame3 = editorAnim3.Frames[e.index]; d.DrawBitmap(frame5.Texture, x + 42 + frame5.Frame.CenterX - (fliph ? (frame5.Frame.Width - editorAnim5.Frames[0].Frame.Width) : 0), y - 68 + frame5.Frame.CenterY + (flipv ? (frame5.Frame.Height - editorAnim5.Frames[0].Frame.Height) : 0), frame5.Frame.Width, frame5.Frame.Height, false, Transparency); d.DrawBitmap(frame4.Texture, x + 42 + frame4.Frame.CenterX - (fliph ? (frame4.Frame.Width - editorAnim4.Frames[0].Frame.Width) : 0), y - 68 + frame4.Frame.CenterY + (flipv ? (frame4.Frame.Height - editorAnim4.Frames[0].Frame.Height) : 0), frame4.Frame.Width, frame4.Frame.Height, false, Transparency); d.DrawBitmap(frame7.Texture, x - 60 + frame7.Frame.CenterX - (fliph ? (frame7.Frame.Width - editorAnim7.Frames[0].Frame.Width) : 0), y - 68 + frame7.Frame.CenterY + (flipv ? (frame7.Frame.Height - editorAnim7.Frames[0].Frame.Height) : 0), frame7.Frame.Width, frame7.Frame.Height, false, Transparency); d.DrawBitmap(frame6.Texture, x - 60 + frame6.Frame.CenterX - (fliph ? (frame6.Frame.Width - editorAnim6.Frames[0].Frame.Width) : 0), y - 68 + frame6.Frame.CenterY + (flipv ? (frame6.Frame.Height - editorAnim6.Frames[0].Frame.Height) : 0), frame6.Frame.Width, frame6.Frame.Height, false, Transparency); 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 + 185 + 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); //e.ProcessAnimation(frame3.Entry.FrameSpeed, frame3.Entry.Frames.Count, frame3.Frame.Duration); d.DrawBitmap(frame3.Texture, x + 185 + frame3.Frame.CenterX - (fliph ? (frame3.Frame.Width - editorAnim3.Frames[0].Frame.Width) : 0), y + 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(DevicePanel d, SceneEntity entity, EditorEntity e, int x, int y, int Transparency) { bool fliph = false; bool flipv = false; var editorAnim = e.LoadAnimation2("SchrodingersCapsule", d, 0, 0, fliph, flipv, false); var editorAnimInside = e.LoadAnimation2("SchrodingersCapsule", d, 0, 2, fliph, flipv, false); var editorAnimExclamation = e.LoadAnimation2("SchrodingersCapsule", d, 0, 3, fliph, flipv, false); var editorAnimButton = e.LoadAnimation2("SchrodingersCapsule", d, 1, -1, fliph, flipv, false); if (editorAnim != null && editorAnim.Frames.Count != 0 && editorAnimButton != null && editorAnimButton.Frames.Count != 0 && editorAnimInside != null && editorAnimInside.Frames.Count != 0 && editorAnimExclamation != null && editorAnimExclamation.Frames.Count != 0) { var frame = editorAnim.Frames[e.index]; var insideFrame = editorAnimInside.Frames[e.index]; var exclamationFrame = editorAnimExclamation.Frames[e.index]; var buttonFrame = editorAnimButton.Frames[e.index]; part1.Draw(d, entity, e, x, y, Transparency); part2.Draw(d, entity, e, x, y, Transparency); d.DrawBitmap(buttonFrame.Texture, x + buttonFrame.Frame.CenterX - (fliph ? (buttonFrame.Frame.Width - editorAnimButton.Frames[0].Frame.Width) : 0), y + exclamationFrame.Frame.CenterY + (flipv ? (buttonFrame.Frame.Height - editorAnimButton.Frames[0].Frame.Height) : 0), buttonFrame.Frame.Width, buttonFrame.Frame.Height, false, Transparency); d.DrawBitmap(exclamationFrame.Texture, x + exclamationFrame.Frame.CenterX - (fliph ? (exclamationFrame.Frame.Width - editorAnimExclamation.Frames[3].Frame.Width) : 0), y + exclamationFrame.Frame.CenterY + (flipv ? (exclamationFrame.Frame.Height - editorAnimExclamation.Frames[3].Frame.Height) : 0), exclamationFrame.Frame.Width, exclamationFrame.Frame.Height, false, Transparency); d.DrawBitmap(insideFrame.Texture, x + insideFrame.Frame.CenterX - (fliph ? (insideFrame.Frame.Width - editorAnimInside.Frames[2].Frame.Width) : 0), y + insideFrame.Frame.CenterY + (flipv ? (insideFrame.Frame.Height - editorAnimInside.Frames[2].Frame.Height) : 0), insideFrame.Frame.Width, insideFrame.Frame.Height, false, Transparency); 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 + frame.Frame.CenterY + (flipv ? (frame.Frame.Height - editorAnim.Frames[0].Frame.Height) : 0), frame.Frame.Width, frame.Frame.Height, false, Transparency); } }