2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2009-07-11 08:02:54 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.swfgradient.construct" xmlns="http://docbook.org/ns/docbook">
|
2007-01-21 05:08:12 +00:00
|
|
|
<refnamediv>
|
2008-07-24 21:54:47 +00:00
|
|
|
<refname>SWFGradient->__construct</refname>
|
2007-01-21 05:08:12 +00:00
|
|
|
<refpurpose>Creates a gradient object</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
|
|
|
<classsynopsis>
|
|
|
|
<ooclass><classname>SWFGradient</classname></ooclass>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>SWFGradient</type><methodname>__construct</methodname>
|
|
|
|
<void/>
|
|
|
|
</methodsynopsis>
|
|
|
|
</classsynopsis>
|
|
|
|
&warn.experimental.func;
|
|
|
|
<para>
|
|
|
|
<function>swfgradient</function> creates a new SWFGradient object.
|
|
|
|
</para>
|
|
|
|
<simpara>
|
|
|
|
After you've added the entries to your gradient, you can use the gradient
|
|
|
|
in a shape fill with the <function>swfshape->addfill</function> method.
|
|
|
|
</simpara>
|
|
|
|
<simpara>
|
|
|
|
SWFGradient has the following methods : <function>swfgradient->addentry</function>.
|
|
|
|
</simpara>
|
|
|
|
<para>
|
|
|
|
This simple example will draw a big black-to-white gradient as background,
|
|
|
|
and a reddish disc in its center.
|
|
|
|
<example>
|
|
|
|
<title><function>swfgradient</function> example</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?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();
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-21 05:08:12 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-04-15 00:12:54 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|