Path: blob/main/static/src/gs/public/radius-raid/js/textpop.js
1338 views
/*==============================================================================1Init2==============================================================================*/3$.TextPop = function( opt ) {4for( var k in opt ) {5this[k] = opt[k];6}7this.alpha = 2;8this.vy = 0;9};1011/*==============================================================================12Update13==============================================================================*/14$.TextPop.prototype.update = function( i ) {15this.vy -= 0.05;16this.y += this.vy * $.dt;17this.alpha -= 0.03 * $.dt;1819if( this.alpha <= 0 ){20$.textPops.splice( i, 1 );21}22};2324/*==============================================================================25Render26==============================================================================*/27$.TextPop.prototype.render = function( i ) {28$.ctxmg.beginPath();29$.text( {30ctx: $.ctxmg,31x: this.x,32y: this.y,33text: '+' + this.value,34hspacing: 1,35vspacing: 0,36halign: 'center',37valign: 'center',38scale: 2,39snap: 0,40render: 141} );42$.ctxmg.fillStyle = 'hsla(' + this.hue + ', ' + this.saturation + '%, ' + this.lightness + '%, ' + this.alpha + ')';43$.ctxmg.fill();44}4546