class sinusScroll{scroll_pt=0;offset=0;font_width=16;font_height=13;display_max_width=1280;scroll_angle=0;constructor(info){this.scrolltext=info.msg??"NO TEXT";this.pos_y=info.pos_y??0;this.dispContext=info.dispContext;this.scroll_speed=info.scroll_speed??1;this.canvasBuffer=document.createElement('canvas');this.canvasBuffer.width=this.display_max_width+this.font_width;this.canvasBuffer.height=this.font_height;this.ctx_canvasBuffer=this.canvasBuffer.getContext("2d");this.canvasBufferTmp=document.createElement('canvas');this.canvasBufferTmp.width=this.canvasBuffer.width;this.canvasBufferTmp.height=this.canvasBuffer.height;this.ctx_canvasBufferTmp=this.canvasBufferTmp.getContext("2d");this.font=new Image();this.font.src="/gfx/font-16x13-alpha.png"} dispFont(context,cx,cy,msg,zoom){context.imageSmoothingEnabled=!1;for(let n=0;n=this.font_width){this.offset=0;var croptext=this.scrolltext.substr(this.scroll_pt,1);this.scroll_pt++;if(this.scroll_pt==this.scrolltext.length){this.scroll_pt=0} this.dispFont(this.ctx_canvasBufferTmp,this.canvasBufferTmp.width-this.font_width,0,croptext,1)} this.ctx_canvasBuffer.clearRect(0,0,this.canvasBuffer.width,this.canvasBuffer.height);this.ctx_canvasBuffer.drawImage(this.canvasBufferTmp,0,0);this.scroll_angle+=8;for(let n=0;n