Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This code segment is extracted from av383695, ALL RIGHTS reserved by original author.
- //URL: http://www.bilibili.tv/video/av383695/
- //PART I: Life Bar I - 生命条1
- function drawContainer(x, y, settings) {
- var pscale = settings.pscale;
- var lifeTime = settings.lifeTime;
- var bar_width = settings.bar_width;
- var bar_height = settings.bar_height;
- var state;
- var blood_graphics;
- var container = $.createCanvas({
- x: x,
- y: y,
- lifeTime: lifeTime
- });
- var g = $.createShape({
- x: 85 * pscale,
- y: 0,
- parent: container,
- lifeTime: lifeTime
- });
- g.graphics.beginFill(0xFFFFFF, 0.6);
- g.graphics.moveTo(0, 0);
- g.graphics.lineTo(pscale * (170 + bar_width + 30), 0);
- g.graphics.lineTo(pscale * (170 + bar_width + 30 - 20), pscale * (bar_height + 25));
- g.graphics.lineTo(pscale * (125 + bar_width * 0.55 + 20 + 13), pscale * (bar_height + 25));
- g.graphics.curveTo(pscale * (125 + bar_width * 0.55 + 20), pscale * (bar_height + 30), pscale * (125 + bar_width * 0.55 + 20), pscale * (bar_height + 30 + 13));
- g.graphics.lineTo(pscale * (125 + bar_width * 0.55 + 20), pscale * (bar_height + 50));
- g.graphics.lineTo(0, pscale * (bar_height + 50));
- g.graphics.lineTo(0, -3);
- /** 血条文字状态区 **/
- g.graphics.drawRoundRect(pscale * (125 + bar_width * 0.55 + 25), pscale * (bar_height + 28), pscale * 210, pscale * 60, 10, 10);
- state = $.createComment(settings.max_blood + " / " + settings.max_blood, {
- x: pscale * (85 + 125 + bar_width * 0.55 + 25) + 3,
- y: pscale * (bar_height + 28) + 35 / 2 * pscale - 5,
- parent: container,
- lifeTime: lifeTime
- });
- state.filters = null;
- state.font = "Berlin Sans FB";
- state.bold = false;
- state.fontsize = 35 * pscale;
- var clv = $.createComment(settings.owner, {
- x: 85 * pscale + 3,
- y: 25 * pscale,
- parent: container,
- lifeTime: lifeTime
- });
- clv.filters = null;
- clv.font = "Berlin Sans FB";
- clv.bold = false;
- clv.fontsize = 28 * pscale;
- var g = $.createShape({
- x: 210 * pscale,
- y: 25 * pscale,
- parent: container,
- lifeTime: lifeTime
- });
- g.graphics.lineStyle(4, 0xB6C33F, 0.4, false, "vertical", "none", "miter", 4);
- g.graphics.moveTo(-3, -3);
- g.graphics.lineTo(pscale * bar_width + pscale * 10, -3);
- g.graphics.lineTo(pscale * (bar_width - 10) + pscale * 10, pscale * bar_height * 0.55 + 2);
- g.graphics.lineTo(pscale * bar_width * 0.55 + 2, pscale * bar_height * 0.55 + 2);
- g.graphics.lineTo(pscale * bar_width * 0.55 - 10 + 2, pscale * bar_height + 3);
- g.graphics.lineTo(-3, pscale * bar_height + 3);
- g.graphics.lineTo(-3, -3);
- g.graphics.lineStyle(2, 0xD4E43C, 0.8, false, "vertical", "none", "miter", 2);
- g.graphics.moveTo(-3, -3);
- g.graphics.lineTo(pscale * bar_width + pscale * 10, -3);
- g.graphics.lineTo(pscale * (bar_width - 10) + pscale * 10, pscale * bar_height * 0.55 + 2);
- g.graphics.lineTo(pscale * bar_width * 0.55 + 2, pscale * bar_height * 0.55 + 2);
- g.graphics.lineTo(pscale * bar_width * 0.55 - 10 + 2, pscale * bar_height + 3);
- g.graphics.lineTo(-3, pscale * bar_height + 3);
- g.graphics.lineTo(-3, -3);
- var g = $.createShape({
- x: 210 * pscale,
- y: 25 * pscale,
- parent: container,
- lifeTime: lifeTime
- });
- blood_graphics = g.graphics;
- settings.container = container;
- settings.state = state;
- settings.blood_graphics = blood_graphics;
- return settings;
- }
- function drawBlood(ctx, bar_blood) { /** 血条 **/
- var pscale = ctx.pscale;
- var bar_width = ctx.bar_width;
- var bar_height = ctx.bar_height;
- ctx.current_blood = bar_blood;
- ctx.state.text = Math.floor(ctx.max_blood * bar_blood) + " / " + ctx.max_blood;
- ctx.state.fontsize = 35 * pscale;
- var alphas = [1, 0.95];
- var ratios = [0x00, 0xFF];
- var matr = $.createMatrix();
- matr.createGradientBox(pscale * 30, pscale * 30, Math.PI * 0.5, 0, 0);
- var colors = [0x669726, 0x7FB23B];
- if(bar_blood <= 0.2) {
- colors = [0xA4003F, 0xBD1B54];
- }
- ctx.blood_graphics.clear();
- ctx.blood_graphics.beginGradientFill("linear", colors, alphas, ratios, matr, "pad");
- ctx.blood_graphics.moveTo(0, 0);
- ctx.blood_graphics.lineTo(pscale * bar_blood * bar_width, 0);
- ctx.blood_graphics.lineTo(pscale * bar_blood * bar_width - 10 < 0 ? 0 : pscale * bar_blood * bar_width - 10, pscale * (bar_blood > 0.55 ? 0.55 : 1) * bar_height);
- if(bar_blood > 0.55) {
- ctx.blood_graphics.lineTo(pscale * bar_width * 0.55, pscale * 0.55 * bar_height);
- ctx.blood_graphics.lineTo(pscale * bar_width * 0.55 - 10, pscale * bar_height);
- }
- ctx.blood_graphics.lineTo(0, pscale * bar_height);
- ctx.blood_graphics.lineTo(0, 0);
- ctx.blood_graphics.endFill();
- }
- function setToBlood(ctx, new_blood) {
- var plus_opt = 1;
- if(new_blood < ctx.current_blood) plus_opt = 0;
- var tmp_blood = ctx.current_blood;
- Utils.interval(function() {
- if(plus_opt) {
- tmp_blood += 0.01;
- } else {
- tmp_blood -= 0.01;
- }
- if(tmp_blood < 0) {
- drawBlood(ctx, 0);
- return false;
- }
- if(tmp_blood > 1) return false;
- drawBlood(ctx, tmp_blood);
- }, 20, Math.abs(new_blood - ctx.current_blood) / 0.01);
- }
- var ctx = drawContainer(10, 5, {
- pscale: 0.5,
- bar_width: 630,
- bar_height: 40,
- max_blood: 900,
- current_blood: 900,
- owner: "Kirito",
- lifeTime: 14
- });
- drawBlood(ctx, ctx.current_blood / ctx.max_blood);
- var colors = [0x2a2929, 0xb7ac96, 0x5e7276, 0x505a5b, 0xfbe1c2, 0x9d746c, 0xe4c198, 0x404247, 0x7f817d, 0x6b5a55, 0xd7bb9d, 0xb29a86, 0xefdebd, 0x7f7866, 0xfef0d6, 0x845c4e, 0x958476, 0x423b3d, 0xbcbcbb, 0x504a4a, 0xa59177, 0x50616c, 0x9fabaf, 0xc59d77, 0xebdec5, 0xffffff, 0x69656a, 0x8e755b, 0x8a8c8b, 0xf1eeea, 0x594a4a, 0x9c8b7d, 0x708495, 0x8d5e5d, 0xe0d4b9, 0x647584, 0x343439, 0x9d9590, 0x999999, 0xfbe7ce, 0xc7b5a8, 0x4e3533, 0xcdac8c, 0xe9cfb3, 0x546774, 0x645753, 0x6c615b, 0x624e4b, 0xf9f3e6, 0x7b7a7a, 0x4a4b50, 0x7c6458, 0xb99379, 0x9e8074, 0x737374, 0xbc9c8b, 0x868d92, 0xcdcbc8, 0x8c7f76, 0x535151, 0x4a4142, 0x6f818f, 0xd7c2ac, 0xfef4ce, 0x8e979b, 0xf8dfc5, 0xa19c92, 0xb5b8ba, 0x8e8a85, 0xcdb39d, 0xaf8b76, 0x6b6363, 0x92625d, 0x5a5b5a, 0xdbdcde, 0x646b73, 0x697985, 0xedd7bc, 0x758c9e, 0x63646a, 0x595353, 0x3b3b3c, 0xe6ccac, 0xc4a08c, 0x6c6d75, 0x635d62, 0xbcb49d, 0x302d2f, 0x454a4c, 0x635252, 0x846261, 0xafa69f, 0x444241, 0x8b766d, 0x7d7271, 0xafaca4, 0x4f4844, 0xa5968a, 0xa98674, 0xccd3d5, 0x82838d, 0xbbb6a9, 0xba9581, 0x9d7973, 0x6b7175, 0xb7a094, 0x695a5c, 0xfef3e0, 0xc8cbcd, 0xfaedcb, 0xcdaa94, 0x7e6e69, 0xdfbd9e, 0xf5deb6, 0xfeeec6, 0x747b85, 0x8e9396, 0x9da5a8, 0x5b6b78, 0xf0d4b6, 0x535358, 0x4b4f54, 0x5a5c61, 0x7c7c84, 0x926d6b, 0x7c5a59, 0x8c685c, 0xe5c7a9, 0x756854, 0x798fa2, 0x716b6a, 0xa79381, 0x514b51, 0xbda384, 0xb88f80, 0x595258, 0x70504d, 0x716564, 0xe4e2d9, 0xc4c4b9, 0x74747b, 0x927369, 0xa58e82, 0x928781, 0x8d837b, 0xc8a892, 0xf8e8c5, 0xb2948f, 0x847b72, 0x5c636b, 0xc6ad8d, 0x4a5a64, 0xd9b69d, 0xd5ae96, 0x7a828d, 0xc4b09c, 0xdfc8af, 0xaca08b, 0x553632, 0x6b5055, 0x5b6671, 0x7c8185, 0xa78179, 0xeccfb0, 0xa97c6c, 0x969c9f, 0xf7e8bf, 0xe6d9cd, 0x413a41, 0x333333, 0x666666, 0x917e72, 0xddd4d0, 0xb39483, 0x684a46, 0xc4a187, 0x3c3d41, 0x806d64, 0x4a444a, 0xfde7c6, 0x4b4949, 0xbfa394, 0x706b71, 0xf9eed8, 0xddc3a0, 0x837269, 0x849094, 0x735851, 0x6e7d8b, 0xfeefce, 0xfff6d6, 0x625c5b, 0x616e79, 0x393239, 0x788b97, 0xa27b73, 0x534344, 0x94948c, 0xf6f7f7, 0x73675d, 0x825c5d, 0x6c6b6b, 0xa48d78, 0x6d747e, 0x958b83, 0x725c5d, 0x5b6264, 0x8c7264, 0x82685e, 0xc3977d, 0x8c6c63, 0xaca095, 0xd3b9a4, 0xd8d8d8, 0xbca987, 0xcccccc, 0x867c79, 0x4a5258, 0x535b61, 0x63717c, 0xdecebd, 0x6a7681, 0xa7a7a9, 0xa3a59b, 0x9b6b62, 0xab937d, 0x8b6264, 0xb6aea8, 0x95887d, 0xa48572, 0xad8a7a, 0xfae5cc, 0x996666, 0xd0a78b, 0xb48575, 0xf4d7b2, 0x636b6b, 0xd7bea7, 0xfef6eb, 0x968c8b, 0xf2e5d7, 0xedcfb4, 0xcdb395, 0x957a6c, 0xf7e0bf, 0x807e88, 0xa17365, 0xb2a8a4, 0xbcb8b7, 0x7d90a0, 0x6c6d63, 0x5c6a73, 0x7b7976, 0x848583, 0x848d8f, 0x949494];
- var matrix = [
- [160, -1, 218, 50, 81, 7, 168, 193, -3, 81, -2, 87, -1, 168, 169, 0, 169, 193, -1, 169, -3, 193, -4, 87, -2, 193, -2, 36, -1, 36],
- [118, 160, 122, 88, 7, 50, 168, 193, 168, 81, -1, 168, -1, 36, 0, 17, -1, 0, -1, 193, 168, -1, 169, 193, -6, 169, -1, 193, 169, 193, -4, 193],
- [192, 160, 122, 7, 121, 135, 178, -1, 92, 81, 178, -1, 193, -1, 47, 135, 193, 0, 87, 168, -2, 193, 168, -2, 193, 168, -2, 87, 193, -2, 169, 168, -2, 36, 36],
- [192, 251, 3, 50, 206, -1, 19, -1, 60, 180, -1, 17, 60, 200, 137, 59, 193, 60, 81, 178, -1, 92, -2, 178, 193, 168, 178, -1, 36, 87, 168, -1, 169, 87, 168, -2, 81, 81],
- [192, -1, 217, 218, 84, 85, 135, -3, 178, 196, 90, -1, 137, 96, 47, -1, 92, 132, -1, 176, 178, 132, 92, 169, 178, -2, 0, 169, 92, -1, 87, -1, 81, 178, -1, 81, 176],
- [192, 21, 3, 79, 140, 191, 71, 191, 137, 80, 47, 124, 103, 177, 45, -1, 103, 30, 19, 135, 180, 168, 59, 132, 169, 92, 132, 180, 81, -2, 178, 168, 87, 60, 81, 50, -1, 176, 7],
- [118, 151, 206, 104, 54, 71, 130, -1, 137, 51, 162, 145, 103, 51, 187, 55, 230, 196, 80, -1, 168, 132, -1, 193, -1, 59, 132, 19, 89, 196, 92, 132, 17, -1, 125, 17, 59, -1, 7, 88],
- [21, -2, 123, 54, 252, -1, 94, 177, 173, 62, 242, 126, 187, 55, 82, 195, 30, 191, 132, 92, 80, 168, -1, 178, 135, 132, 9, 124, 60, 59, -1, 17, 125, 5, 60, 135, -1, 88, 121],
- [21, 160, 218, 8, 252, 253, 216, 93, 230, 83, 237, 230, 187, 230, 163, -1, 141, 89, 191, 92, 59, 178, -2, 80, -2, 53, 171, 60, 106, 89, 136, 173, 155, 47, 59, 85, 121, 120],
- [118, -1, 253, -1, 68, -1, 58, 173, 102, 83, -1, 210, -1, 127, 244, 127, 208, 106, 59, 180, -1, 73, 59, -1, 191, 135, 185, 55, 199, 30, 137, 187, 230, 82, -1, 208, 80, 26, 120, 122],
- [76, 28, 91, 253, 197, 228, 55, -2, 102, 225, 208, 98, 110, 77, 152, 187, 45, 19, 17, 19, 85, 80, 71, 191, 199, 11, 142, 80, 137, 205, 229, 82, 244, 77, 243, 59, 26, 122, 75],
- [255, 247, 255, 28, 97, 155, 171, 130, 252, 58, -1, 207, 230, -1, 55, -1, 9, 80, -1, 19, 130, 137, -1, 130, 46, 229, 155, 148, 45, 111, 53, 212, 156, -1, 62, 243, 19, 182, 79, 104],
- [95, 91, 197, 37, 155, 93, 130, 223, -1, 213, 38, 19, 9, 141, 195, 141, 46, 94, 130, -1, 216, 94, -2, 171, 69, 97, 199, 46, 208, 98, 173, 55, 145, 69, 16, 180, 54, 75, 140],
- [138, 95, 68, 105, 62, 177, 91, 57, 248, 215, 49, 132, 92, -1, 89, 205, 148, 143, 111, 144, -3, 93, 155, -1, 185, 9, 207, 53, -1, 98, 173, 11, 181, 58, 7, 54, -1, 161],
- [67, 139, 211, 105, 62, 43, 105, 213, 138, 95, 116, 26, 73, 59, 80, 46, 143, 144, 148, 239, 143, -1, 93, 55, 212, 16, 51, 210, 141, 93, 185, 46, -2, 148, 250, 88, 54, 161, 100],
- [149, 38, 220, 55, 181, 65, 241, 167, 198, 247, 239, 216, 94, 253, 223, 143, -1, 148, 204, 97, -1, 16, 11, 237, 230, 229, 173, 208, 37, 227, 201, 178, 92, -1, 49, 122, 50, 104, 100, 56],
- [154, 3, 91, 110, 70, 82, 65, 231, 238, 172, 147, 141, 16, 248, 167, 97, 228, 216, 97, -1, 31, 225, 10, 133, 242, 119, -1, 105, 227, 255, 191, -1, 73, 170, 222, 79, 217, 104, 100, 64],
- [99, 218, 19, 142, 52, 153, 244, -1, 39, 240, 83, 55, 70, 62, 220, 131, 16, 204, 97, 142, 225, 184, -1, 119, 109, -2, 167, 97, 37, 94, 253, 255, 18, 99, 201, 218, 104, 254, 254],
- [108, 104, 7, 30, 126, 209, 119, 244, -1, 231, 43, 184, -1, 12, 156, 131, 16, 97, 131, -1, 82, 146, 109, 189, -3, 48, 40, 142, 243, 211, 57, 198, 215, 252, 104, 140, 186, 254],
- [188, 192, 88, 60, 41, 15, 163, 113, 4, 39, 189, -3, 10, 202, 131, -1, 225, 127, 189, -2, 63, -3, 183, 242, 145, 11, 40, 29, 25, 101, 68, 8, 161, 64, 38],
- [188, 221, 217, 180, 60, 158, 153, 244, 4, 179, 189, -3, 242, 202, 225, -1, 127, 179, 189, 63, -6, 12, 184, 42, 34, 107, 183, 1, 66, 8, 100, 64, 117],
- [188, 221, 218, 50, 196, 158, 98, 244, 4, 179, -1, 189, -1, 146, 175, 70, 133, 127, 244, 189, -2, 63, -9, 14, 24, 157, 66, 8, 254, 18, 74],
- [219, 192, 218, 50, 135, 174, 15, 119, 4, 179, 189, -2, 113, 23, 42, 163, -1, 244, 189, -10, 14, -2, 62, 157, 211, 223, 186, 64, 76],
- [251, -1, 75, 79, 54, 137, 174, 152, 4, 179, 189, -2, 6, -1, 146, 244, 235, 146, 189, -4, 190, -7, 109, 214, 1, 204, 252, 115, 251, 251],
- [219, 115, 154, 115, 26, 94, 174, 134, 244, 4, 109, -1, 244, 235, 189, -2, 113, 235, 189, 63, -6, 190, -4, 82, 150, 86, 250, 56, 115, 2, 22],
- [76, 154, -1, 245, 201, 71, 205, 126, 163, 244, 179, -3, 189, -3, 166, 189, 63, -10, 109, 184, 34, 13, 8, 22, 154, 165, 198],
- [221, -1, 154, 100, 140, 85, 106, 90, 110, 244, 4, 109, -1, 189, -3, 63, -13, 146, -1, 157, 46, 115, 64, 186, 74, 25],
- [149, 192, 115, 100, 140, 26, 191, 205, 5, 241, 244, 179, -1, 189, -2, 114, -1, 63, -13, 62, 128, 49, 154, 221, 22, 25, 25],
- [21, -1, 203, 115, 140, 182, 71, 89, 205, 230, 241, 4, 179, 189, -1, 179, -1, 189, 63, -11, 109, 12, 16, 130, 123, 154, 219, 117, 25, 25],
- [67, 115, 149, 75, 84, -1, 182, 191, 89, 125, 5, 43, 4, -1, 179, 244, 113, 109, 63, -1, 166, 63, -7, 109, 77, 20, 46, 54, 203, -1, 219, 76, 74, 25],
- [25, 74, 104, 122, 79, 54, -1, 85, 80, 89, 136, 164, 152, 244, 179, -2, 189, -2, 166, 109, 14, -4, 109, 12, 150, 27, 128, 85, 79, 192, 219, -2, 22, 25],
- [108, 67, 206, 120, 122, 79, 54, 182, 135, 96, -1, 33, 224, 209, 119, 179, -2, 189, -6, 146, 82, 133, 27, 187, -1, 191, 79, -1, 192, -1, 35, -1, 61, 99],
- [206, 218, 3, -1, 122, -1, 182, 54, 85, 19, -1, 200, 72, -1, 98, 127, 4, 179, 189, -4, 12, 242, 52, 164, 187, -1, 46, -1, 170, 75, -2, 192, 76, 32, -1, 194],
- [218, 217, 3, -3, 26, 54, 85, 59, 30, 90, -1, 226, 72, 246, 10, 4, 39, -1, 244, 82, 42, 209, -1, 134, 207, 9, 71, -1, 26, 84, 115, -1, 251, -1, 35, 249, 78, 32],
- [104, 79, 121, -1, 50, 120, 85, 54, 85, 59, -1, 53, 200, 226, -2, 224, 145, 43, 152, 175, 209, 175, -1, 145, 11, 46, 71, 140, -1, 123, 100, -2, 219, 118, 219, 32, 129, 78],
- [84, 79, 88, -1, 7, 59, 73, 201, 85, 59, 45, 181, 200, -1, 226, -1, 232, 224, 164, 234, 209, 233, 153, -1, 212, 31, 80, 85, 140, 245, -2, 154, 194, 188, 44, 118, 76, 129, 129],
- [206, 120, 88, 176, -1, 178, 120, 122, 135, 59, 45, 212, 124, 200, 226, -1, 5, 164, 234, 175, 152, 163, -1, 10, 62, 199, 59, -1, 122, 84, 203, 84, -1, 221, 219, 21, 44, 35, 32, 129],
- [206, 73, 120, 88, 81, -1, 50, 135, -1, 132, 45, 69, 173, 210, 124, 229, 70, 209, 152, 12, 146, -1, 77, 82, 155, 47, -1, 132, -1, 121, 149, 116, 165, 117, 165, 186, 118, -1, 35, 129],
- [85, 122, -1, 120, 7, 169, 92, 59, -1, 180, 177, 145, -1, 195, -1, 102, 175, 112, 244, 179, 109, -1, 12, -1, 202, 30, -1, 50, 121, 88, 206, 108, 25, -2, 198, 154, 44, 35, 32],
- [85, -1, 120, -1, 50, 36, 81, 132, -1, 180, 243, 83, 69, 230, -1, 175, 153, 119, 109, -1, 189, 109, 12, 163, 207, 30, 19, 121, 122, -1, 217, 218, 108, 25, -2, 165, 21, 35, 188]
- ];
- $G._set("colors", colors);
- $G._set("matrix", matrix);
- var g = $.createShape({
- x: 0,
- y: 0,
- parent: ctx.container,
- lifeTime: 14
- });
- for(y = 0; y < matrix.length; y++) {
- hasPoint = fales;
- bx = 0;
- for(x = 0; x < matrix[y].length; x++) {
- mIndex = matrix[y][x];
- if(mIndex < 0) {
- bx += -mIndex;
- continue;
- }
- if(mIndex == 999) {
- alpha = 0;
- } else {
- alpha = 1;
- }
- if(!hasPoint) {
- hasPoint = true;
- g.graphics.moveTo(bx - 1, y);
- }
- g.graphics.lineTo(bx, y);
- g.graphics.lineStyle(1, colors[mIndex], alpha, true, "none", "none", "bevel", 1);
- bx++;
- }
- }
- var ctx_monster = drawContainer(18, Player.height - 55, {
- pscale: 0.4,
- bar_width: 630,
- bar_height: 40,
- max_blood: 9999,
- current_blood: 9999,
- LV: "??",
- owner: "便当甲",
- lifeTime: 14
- });
- drawBlood(ctx_monster, ctx_monster.current_blood / ctx_monster.max_blood);
- Utils.delay(function() {
- setToBlood(ctx_monster, 0);
- }, 10000);
- //PART II: Login - 登录
- ScriptManager.clearEl();
- var galTextTmr;
- function setGaltext(oTxt, txt, onfinish)
- {
- if (galTextTmr!=undefined)
- {
- galTextTmr.stop();
- }
- var galTextTmr = interval(function(){ oTxt.text+=txt.substr(oTxt.length,1);
- if (oTxt.length==txt.length)
- {
- if (onfinish!=undefined) onfinish();
- }
- }, 100, txt.length);
- }
- var login_box = $.createCanvas({x:70,y:120,lifeTime:8});
- var sg = $.createShape({parent: login_box,lifeTime:8}), g=sg.graphics;
- g.beginFill(0xffffff, 0.6);
- g.drawRoundRect(0, 0, 400, 200, 20);
- g.endFill();
- var sg = $.createShape({parent: login_box,x:130, y:16,lifeTime:8}), g=sg.graphics;
- g.beginFill(0xffffff, 0.8);
- g.drawRoundRect(0, 0, 200, 30, 10);
- g.drawRoundRect(0, 60, 200, 30, 10);
- g.endFill();
- $.createComment("ALO帐号:", {x:80, y:140, fontsize:20,lifeTime:8});
- $.createComment("ALO密码:", {x:80, y:200, fontsize:20,lifeTime:8});
- var lblST = $.createComment(" ", {color:0xff9966,x:210, y:260,alpha:0.9,fontsize:20,lifeTime:8});
- var cmtf = lblST.getTextFormat(0,1);cmtf.bold=false;lblST.setTextFormat(cmtf,0,1);
- var lblUser = $.createComment("|", {x:210, y:140,color:0,fontsize:20,lifeTime:8});
- var lblPassword = $.createComment("", {x:210, y:200,color:0,fontsize:20,lifeTime:8});
- lblUser.filters = null;
- Utils.delay(function(){
- lblUser.text = "";
- setGaltext(lblUser, "Kirito", function(){
- lblPassword.filters = null;
- setGaltext(lblPassword, "********", function(){
- lblST.text = "正在使用意念登录中。。。";
- Utils.delay(function(){
- lblST.text = "您的帐号已欠费。。。";
- },1300);
- });
- });
- }, 500);
- //PART III: Life Bar II - 生命条2
- ScriptManager.clearEl();
- var lifetime = 10;
- function drawHSP(g, hp_value, sp_value)
- {
- g.clear();
- g.lineStyle(1,0xffffff);g.lineTo(0,hsp_bar_height);g.lineTo(128,hsp_bar_height);g.lineTo(131,hsp_bar_height / 2);g.lineTo(127,0);g.lineTo(1,0);
- var matr = $.createMatrix();
- matr.createGradientBox(hsp_bar_width, hsp_bar_height / 4, Math.PI*0.5, 0, 0);
- g.lineStyle(undefined);
- g.beginGradientFill("linear", [0x00CC00, 0x80FF20], [0.8, 1], [0x00, 0xFF], matr, "reflect");
- g.moveTo(1,1); g.lineTo(1,hsp_bar_height / 2); g.lineTo(hsp_bar_width * hp_value,hsp_bar_height / 2); g.lineTo(hsp_bar_width * hp_value, 1); g.lineTo(1, 1);
- g.endFill();
- g.beginGradientFill("linear", [0x0000CC, 0x2080C8], [0.8, 1], [0x00, 0xFF], matr, "reflect");
- g.moveTo(1,1+hsp_bar_height / 2); g.lineTo(1,hsp_bar_height); g.lineTo(hsp_bar_width * sp_value,hsp_bar_height); g.lineTo(hsp_bar_width * sp_value, hsp_bar_height / 2 + 1); g.lineTo(1, hsp_bar_height / 2 + 1);
- g.endFill();
- }
- var name = $.createComment("Lifa",{x:328, y:75, lifeTime:lifetime,fontsize:10,color:0xffffff});
- name.filters = [];
- name.font = "Berlin Sans FB";
- name.bold = false;
- var sp=$.createShape({x:331,y:71,lifeTime:lifetime}), g=sp.graphics;
- var alphas = [0.4, 0];
- var ratios = [0x00, 0xFF];
- var colors = [0xcccccc, 0xcccccc];
- var matr = $.createMatrix();
- matr.createGradientBox(150, 200, 0, 0, 0);
- g.lineStyle(undefined);
- g.beginGradientFill("linear", colors, alphas, ratios, matr, "pad");
- g.lineTo(-8,12);g.lineTo(-1,24);g.lineTo(179,21);g.lineTo(178,2);g.lineTo(0,0);
- g.endFill();
- var hsp_bar_height = 12;
- var hsp_bar_width = 120;
- sp_bar=$.createShape({x:353,y:76,alpha:0.7,lifeTime:lifetime}), g=sp_bar.graphics;
- var sp_value = 0.9;
- drawHSP(g, 1, sp_value);
- Utils.delay(function(){
- Utils.interval(function(){
- sp_value-=0.01;
- drawHSP(g, 1, sp_value);
- }, 100, 40);
- }, 300);
Advertisement
Add Comment
Please, Sign In to add comment