找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1460|回复: 23

自定义stats签名成功

[复制链接]
发表于 2012-9-13 15:29:13 | 显示全部楼层 |阅读模式
需要的提供图片,想法,排版。 1000盾1个 :DD
试试几个SX套用的效果

回复

使用道具 举报

发表于 2012-9-13 15:31:24 | 显示全部楼层
1000盾求教程
回复

使用道具 举报

发表于 2012-9-13 15:31:32 | 显示全部楼层
嗯嗯 不是要统一风格吗 怎么都很个性
回复

使用道具 举报

 楼主| 发表于 2012-9-13 15:38:32 | 显示全部楼层
=|HERO|=RED丶 发表于 2012-9-13 15:31
嗯嗯 不是要统一风格吗 怎么都很个性

模板而已。如果有统一需求的话 会有统一版本
回复

使用道具 举报

 楼主| 发表于 2012-9-13 15:40:13 | 显示全部楼层
本帖最后由 =|HERO|=Depower 于 2012-9-13 15:43 编辑
=|HERO|=ZeRooo 发表于 2012-9-13 15:31
1000盾求教程
  1. //Modified by HERO houzi

  2. defaults.text.size=10;
  3. defaults.text.color='ff8a00';
  4. defaults.text.font='0oAmGAtL60NkDOrkfA/Purista-SemiBold.ttf';

  5. //Background
  6. image({file:'0p4cUbkIy0ufpwLvMw/hero1.png', x:0, y:0});

  7. // Script

  8. function secondstotime(secs)
  9. {
  10.     var t = new Date(1970,0,1);
  11.     t.setSeconds(secs);
  12.     var s = t.toTimeString().substr(0,8);
  13.     if(secs > 86399)
  14.         s = Math.floor((t - Date.parse('1/1/70')) / 3600000) + s.substr(2);
  15.     return s;
  16. }


  17. // 1April's list sort script
  18. // func(list of objects, field of objects to use for sort)
  19. var getSortedList=function(list,field){
  20.         if(typeof(list)!='object') return list;
  21.         var slist=[];
  22.         for(var n in list) slist.push([n,list[n]]);
  23.         slist.sort(function(a,b){
  24.                 var v1=a[1], v2=b[1];
  25.                 v1=(typeof(v1)!='object' || typeof(v1[field])!='number')?0:v1[field];
  26.                 v2=(typeof(v2)!='object' || typeof(v2[field])!='number')?0:v2[field];
  27.                 return v2-v1;
  28.         });
  29.         if(list instanceof Array) {
  30.                 var ret=[];
  31.                 for(var i in slist) ret.push(slist[i][1]);
  32.                 return ret;
  33.         } else {
  34.                 var ret={};
  35.                 for(var i in slist) ret[slist[i][0]]=slist[i][1];
  36.                 return ret;
  37.         }
  38. };

  39. //time
  40. // Tiempo

  41. var tiempo=p.stats.global.time/3600;
  42. var tiempomin=p.stats.global.time/60;
  43. var tiempom=tiempomin.toFixed(0)-tiempo.toFixed(0)*60+60

  44. // Fav. kit
  45. var score2kit={
  46. assault:p.stats.scores.assault,
  47. engineer:p.stats.scores.engineer,
  48. recon:p.stats.scores.recon,
  49. support:p.stats.scores.support
  50. };
  51. var favkit='assault';
  52. var favkitscore=0;
  53. for(var kit in score2kit){
  54.   if(score2kit[kit]<=favkitscore) continue;
  55.   favkitscore=score2kit[kit];
  56.   favkit=kit;
  57. }

  58. var kit_sx=0;
  59. var kit_sy=0;
  60. if(favkit == 'assault')
  61. {kit_sx=0;
  62. kit_sy=0;}
  63. else if(favkit == 'engineer')
  64. {kit_sx=16;
  65. kit_sy=0;}
  66. else if(favkit == 'support')
  67. {kit_sx=0;
  68. kit_sy=16;}
  69. else
  70. {kit_sx=16;
  71. kit_sy=16;}

  72. kdrcolor = '';
  73. kdr=(p.stats.global.kills/p.stats.global.deaths);
  74. if(kdr >= 0) {kdrcolor='de0000';}
  75. if(kdr >= 1) {kdrcolor='ff4800';}

  76. wlrcolor = '';
  77. wlr=(p.stats.global.wins/p.stats.global.losses);
  78. if(wlr >= 0) {wlrcolor='de0000';}
  79. if(wlr >= 1) {wlrcolor='ff4800';}


  80. //MAIN SIGNATURE ******

  81. // Rank / Country / Name
  82. var rcnx=303;
  83. var rcny=18;

  84. //KIT
  85. //Kit image
  86. image({file:'06xhlEg8G19UvkJiy4/kits_white.png', x:rcnx-55, y:5, w:18, h:18, sx:kit_sx,sy:kit_sy,sw:16,sh:16});

  87. // Rank image
  88. image({file:p.stats.rank.img_tiny, x:6, y:rcny-15});

  89. // Flag
  90. image({file:'flags/cn.png', x:rcnx-34, y:rcny-9, w:16, h:11});

  91. //Player Name
  92. text({text:p.name, font:'0oAmGAtL60NkDOrkfA/Purista-Bold.ttf', x:39, y:21, size:16, color:'FFFFFF'});

  93. //ACTUAL STATS

  94. var firstcol=4;
  95. var firstcolstat=118;
  96. var secondcol=121;
  97. var secondcolstat=222;

  98. //FIRST COLUMN NAME
  99. text({x:firstcol, y:39, text:'Score', color:'6a6a6a'});
  100. text({x:firstcol, y:53, text:'Kills', color:'6a6a6a'});
  101. text({x:firstcol, y:67, text:'Deaths', color:'6a6a6a'});
  102. text({x:firstcol, y:81, text:'K/D', color:'6a6a6a'});
  103. text({x:firstcol, y:95, text:'SPM', color:'6a6a6a'});

  104. //FIRST COLUMN STAT
  105. text({x:firstcolstat, y:39, text:p.stats.scores.score, align:'right'});
  106. text({x:firstcolstat, y:53, text:p.stats.global.kills, align:'right'});
  107. text({x:firstcolstat, y:67, text:p.stats.global.deaths, align:'right'});
  108. text({x:firstcolstat, y:81, text:(p.stats.global.kills/p.stats.global.deaths).toFixed(2), align:'right', color:kdrcolor});
  109. text({x:firstcolstat, y:95, text:(p.stats.scores.score/tiempomin).toFixed(1), align:'right'});


  110. //SECOND COLUMN NAME
  111. text({x:secondcol, y:39, text:'Wins', color:'6a6a6a'});
  112. text({x:secondcol, y:53, text:'Losses', color:'6a6a6a'});
  113. text({x:secondcol, y:67, text:'W/L', color:'6a6a6a'});
  114. text({x:secondcol, y:81, text:'Time', color:'6a6a6a'});
  115. text({x:secondcol, y:95, text:'Skill', color:'6a6a6a'});

  116. //SECOND COLUMN STAT
  117. text({x:secondcolstat, y:39, text:p.stats.global.wins, align:'right'});
  118. text({x:secondcolstat, y:53, text:p.stats.global.losses, align:'right'});
  119. text({x:secondcolstat, color:wlrcolor, y:67, text:(p.stats.global.wins/p.stats.global.losses).toFixed(2), align:'right'});
  120. text({x:secondcolstat, y:81, text:secondstotime(p.stats.global.time), align:'right'});
  121. text({x:secondcolstat, y:95, text:(p.stats.global.elo).toFixed(0), align:'right'});

  122. // get weapons list sorted by number of kills
  123. var bestweaps=getSortedList(p.stats.vehicles,'kills');
  124. //bestwep
  125. // find best gun in sorted weapons list, excluding pistols
  126. wcount=0;
  127. for (n in bestweaps) {
  128.     if (bestweaps[n].category!='Pistols' && wcount!=1) {
  129.        wcount++;
  130.        if (wcount==1) weapy=33;
  131. image({x:224, y:weapy-3, file:bestweaps[n].img, w:62, h:38});
  132.        wtext='';
  133.        wtext='[ '+bestweaps[n].name+' ]';
  134.        text({x:224, y:weapy+3, size:7, text:wtext});
  135.        wtext=bestweaps[n].kills + ' kills';
  136.        text({x:325, y:weapy+28, size:7, text:wtext, align:'right'});
  137. }
  138. }
复制代码
这个是上图所用代码。很简单的,可以控制想显示什么东西(什么都可以),字体及大小,背景图案,整体大小等等。
回复

使用道具 举报

发表于 2012-9-13 15:46:04 | 显示全部楼层
猴哥...要不还是给你盾你帮我弄一个吧..
回复

使用道具 举报

发表于 2012-9-13 15:47:24 | 显示全部楼层
ID   :  Mustang_CN

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

 楼主| 发表于 2012-9-13 16:04:20 | 显示全部楼层
  1. [img]http://g.bf3stats.com/pc/kxGhEIXn/Mustang_CN.png[/img]
复制代码
建议重新做底图,这个不好配色
回复

使用道具 举报

发表于 2012-9-13 16:36:43 | 显示全部楼层
=|HERO|=Depower 发表于 2012-9-13 16:04
建议重新做底图,这个不好配色

背景图大小有要求吗~
回复

使用道具 举报

发表于 2012-9-13 17:12:08 | 显示全部楼层
KD 0.65 的若爆了
回复

使用道具 举报

发表于 2012-9-13 17:12:45 | 显示全部楼层
=|HERO|=ZeRooo 发表于 2012-9-13 16:36
背景图大小有要求吗~

话说你用我做的签名多久了。回头补盾啊~
回复

使用道具 举报

发表于 2012-9-13 17:14:53 | 显示全部楼层
=|HERO|=ZeRooo 发表于 2012-9-13 15:47
ID   :  Mustang_CN

http://bbs.heroclan.net/thread-391200-1-1.html
回复

使用道具 举报

发表于 2012-9-13 17:31:47 | 显示全部楼层
=|HERO|=Ht19ES 发表于 2012-9-13 17:12
话说你用我做的签名多久了。回头补盾啊~

...老总 我是良民啊  昨天在论坛看到的...
回复

使用道具 举报

发表于 2012-9-13 17:51:12 | 显示全部楼层
跪求
回复

使用道具 举报

 楼主| 发表于 2012-9-13 17:52:29 | 显示全部楼层
=|HERO|=FeiWen8 发表于 2012-9-13 17:51
跪求

医生要啥样子的?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|=|HERO|=战队

GMT+8, 2024-7-4 13:44

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表