SWFGradient
(PHP 4 >= 4.0.5)
SWFGradient -- 傾きオブジェクトを作成する
説明
new
swfgradient ( void )
警告 |
この関数は、
実験的なステータスにあります。これは、この関数の
動作、関数名、ここで書かれていること全てがPHPの将来のバージョンで予告
なく変更される可能性があることを意味します。注意を喚起するとともに自分
のリスクでこの関数を使用して下さい。 |
swfgradient() creates a new SWFGradient object.
After you've added the entries to your gradient, you can use the gradient
in a shape fill with the swfshape->addfill() method.
SWFGradient has the following methods : swfgradient->addentry().
This simple example will draw a big black-to-white gradient as background,
and a redish disc in its center.
例 1. swfgradient() の例
<?php
$m = new SWFMovie(); $m->setDimension(320, 240);
$s = new SWFShape();
// first gradient- black to white $g = new SWFGradient(); $g->addEntry(0.0, 0, 0, 0); $g->addEntry(1.0, 0xff, 0xff, 0xff);
$f = $s->addFill($g, SWFFILL_LINEAR_GRADIENT); $f->scaleTo(0.01); $f->moveTo(160, 120); $s->setRightFill($f); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240);
$m->add($s);
$s = new SWFShape();
// second gradient- radial gradient from red to transparent $g = new SWFGradient(); $g->addEntry(0.0, 0xff, 0, 0, 0xff); $g->addEntry(1.0, 0xff, 0, 0, 0);
$f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); $f->scaleTo(0.005); $f->moveTo(160, 120); $s->setRightFill($f); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240);
$m->add($s);
header('Content-type: application/x-shockwave-flash'); $m->output(); ?>
|
|