php-doc-en/reference/ming/functions/swfshape.setline.xml
Hartmut Holzgraefe 5b9fc29465 revision tags added
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
2002-04-17 06:45:35 +00:00

118 lines
3.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/ming.xml, last change in rev 1.24 -->
<refentry id="function.swfshape.setline">
<refnamediv>
<refname>SWFShape->setLine</refname>
<refpurpose>Sets the shape's line style.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swfshape->setline</methodname>
<methodparam><type>int</type><parameter>width</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>red</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>green</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>blue</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>a</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
<para>
<function>swfshape->setline</function> sets the shape's line style.
<parameter>width</parameter> is the line's width. If <parameter>width</parameter>
is 0, the line's style is removed (then, all other arguments are ignored).
If <parameter>width</parameter> > 0, then line's color is set to
<parameter>red</parameter>, <parameter>green</parameter>, <parameter>blue</parameter>.
Last parameter <parameter>a</parameter> is optional.
</para>
<simpara>
<function>swfshape->setline</function> accepts 1, 4 or 5 arguments
(not 3 or 2).
</simpara>
<para>
You must declare all line styles before you use them (see example).
</para>
<para>
This simple example will draw a big "!#%*@", in funny colors and
gracious style.
<example>
<title><function>swfshape->setline</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$s = new SWFShape();
$f1 = $s->addFill(0xff, 0, 0);
$f2 = $s->addFill(0xff, 0x7f, 0);
$f3 = $s->addFill(0xff, 0xff, 0);
$f4 = $s->addFill(0, 0xff, 0);
$f5 = $s->addFill(0, 0, 0xff);
// bug: have to declare all line styles before you use them
$s->setLine(40, 0x7f, 0, 0);
$s->setLine(40, 0x7f, 0x3f, 0);
$s->setLine(40, 0x7f, 0x7f, 0);
$s->setLine(40, 0, 0x7f, 0);
$s->setLine(40, 0, 0, 0x7f);
$f = new SWFFont('Techno.fdb');
$s->setRightFill($f1);
$s->setLine(40, 0x7f, 0, 0);
$s->drawGlyph($f, '!');
$s->movePen($f->getWidth('!'), 0);
$s->setRightFill($f2);
$s->setLine(40, 0x7f, 0x3f, 0);
$s->drawGlyph($f, '#');
$s->movePen($f->getWidth('#'), 0);
$s->setRightFill($f3);
$s->setLine(40, 0x7f, 0x7f, 0);
$s->drawGlyph($f, '%');
$s->movePen($f->getWidth('%'), 0);
$s->setRightFill($f4);
$s->setLine(40, 0, 0x7f, 0);
$s->drawGlyph($f, '*');
$s->movePen($f->getWidth('*'), 0);
$s->setRightFill($f5);
$s->setLine(40, 0, 0, 0x7f);
$s->drawGlyph($f, '@');
$m = new SWFMovie();
$m->setDimension(3000,2000);
$m->setRate(12.0);
$i = $m->add($s);
$i->moveTo(1500-$f->getWidth("!#%*@")/2, 1000+$f->getAscent()/2);
header('Content-type: application/x-shockwave-flash');
$m->output();
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- 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
sgml-default-dtd-file:"../../../../manual.ced"
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
-->