|
发表于 2012-9-12 13:37:25
|
显示全部楼层
本帖最后由 =|HERO|=Depower 于 2012-9-12 16:10 编辑
测试用~
- //defaults.text.size=10;
- defaults.text.size=8;
- defaults.text.color='000000';
- defaults.text.font='0p4cUbkIy0ufpwLvMw/AVGARDM.TTF';
- // Background image
- image({file:'0p4cUbkIy0ufpwLvMw/hero1.png', x:0, y:-10});
- // Name
- text({x:266, y:53, align:'left', text:p.name, size:15, color:'ffffff', font:'0p4cUbkIy0ufpwLvMw/AVGARDM.TTF'});
- text({x:266, y:36, size:10, color:'000000', font:'0p4cUbkIy0ufpwLvMw/AVGARDM.TTF', text:p.stats.rank.name});
- // Rank Image
- image({file:p.stats.rank.img_small, x:373, y:48});
- // Text
- text({x:266, y:70, align:'left', text:'Score: '});
- text({x:320, y:70, align:'left', text:p.stats.scores.score});
- text({x:266, y:83, align:'left', text:'Kills: '});
- text({x:320, y:83, align:'left', text:p.stats.global.kills});
- text({x:266, y:96, align:'left', text:'Time: '});
- text({x:320, y:96, align:'left', text:thetime(p.stats.global.time,'d\\T h\\H'),});
- // K/D code
- var kdr=p.stats.global.kills&&p.stats.global.deaths?p.stats.global.kills/p.stats.global.deaths:0;
- var kdcolor=kdr>=1?'26f305':'ff0000';
- // K/D stat
- //text({x:311, y:10, align:'right', color:141414, text:'k/d: '});
- text({x:266, y:109, align:'left', text:'K/D: '});
- text({x:340, y:109, align:'left', color:141414, text:kdr.toFixed(2)});
- text({x:340, y:109, align:'left', color:kdcolor, text:kdr.toFixed(2)});
- // Fav. kit
- var score2kit={
- recon:p.stats.scores.recon,
- assault:p.stats.scores.assault,
- engineer:p.stats.scores.engineer,
- support:p.stats.scores.support
- };
- var favkit='recon';
- var favkitscore=0;
- for(var kit in score2kit){
- if(score2kit[kit]<=favkitscore) continue;
- favkitscore=score2kit[kit];
- favkit=kit;
- }
- var kit_sx=0;
- var kit_sy=0;
- if(favkit == 'recon')
- {kit_sx=0;
- kit_sy=0;}
- else if(favkit == 'assault')
- {kit_sx=17;
- kit_sy=0;}
- else if(favkit == 'engineer')
- {kit_sx=0;
- kit_sy=17;}
- else
- {kit_sx=17;
- kit_sy=17;}
- //Kit image
- image({file:'0oveiPvCB10nidqUc5/bf3kits_small.png', x:399, y:39, w:17, h:17, sx:kit_sx,sy:kit_sy,sw:17,sh:17});
复制代码 |
|