Branch: Tag:

1997-09-12

1997-09-12 21:17:50 by Johan Schön <js@opera.com>

Added fadein.

Rev: server/modules/graphics/graphic_text.pike:1.72

1: - constant cvs_version="$Id: graphic_text.pike,v 1.71 1997/09/12 06:14:32 per Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.72 1997/09/12 21:17:50 js Exp $";   constant thread_safe=1;      #include <module.h>
91:    " parse the whole document.\n"    " help Display this text\n"    " scroll=width,steps,delay Make a horrible scrolltext\n" +  " fadein=blur,steps,delay,initialdelay Make a (somewhat less) horrible fadein\n"    "\n"    "<b>Arguments passed on the the &lt;a&gt; tag (if href is specified):</b>\n "    " target=...\n"
361:    ysize+=(int)args->bshadow+3;    }    +  if(args->fadein) +  { +  xsize+=6; +  ysize+=6; +  xoffset+=3; +  yoffset+=3; +  } +     if(args->move)    {    int dx,dy;
736:   // place in cache, as a gif image.       if(!args->scroll) +  if(args->fadein)    { -  +  int amount=2, steps=10, delay=10, initialdelay=0, ox; +  string res = img->gif_begin(); +  sscanf(args->fadein, "%d,%d,%d,%d", amount, steps, delay, initialdelay); +  if(initialdelay) +  { +  object foo=image(img->xsize(),img->ysize(),0,0,0); +  res += foo->gif_add(0,0,initialdelay); +  } +  for(int i = 0; i<steps; i++) +  { +  object foo=img->clone(); +  foo = foo->apply_matrix(make_matrix(( (int)((steps-i)*amount)))); +  werror((string)i); +  res += foo->gif_add(0,0,delay); +  } +  res+= img->gif_add(0,0,delay); +  res += img->gif_end(); +  data = ({ res, ({ img->xsize(), img->ysize() }) }); +  } +  else +  {    if(args->fs)    data=({ img->togif_fs(@(args->notrans?({}):parse_color(args->bg))),    ({img->xsize(),img->ysize()})});
759:    res += img->gif_end();    data = ({ res, ({ len, img->ysize() }) });    } +  +     cache_set(key, text, data);    if(size) return data[1];    return data[0];