Что такое код swfdisplayitem >rotateto


��� ����� ��� swfdisplayitem >rotateto

����� ���� ���������� ��������� ������ � �������� �������! � ���������� ��� ����� ���������� ������������.

���� �� �������� ����� ������ ���������, ����������, �������� �� ���� ���������� ����� �� ����� ��������� ������ «������».

Rotation Control
������: 3.2.3

��������� ���������� ��������� � �����: 10.11.2020

������� ��������:
���������� ��������� ������ ���������� ������ � �����������, �� ����������������� ������ �����������.

��������:
��������� ����� ������� ������ � ��������� � ������� � ������������� ���������.

������������� ���, ���:
— ����� �������� ���������� �������� ������ ��������� �� ���������.
— ����� �������� ���������� ��� � ���������������, ���������� � ��������� ������, �� ����������.
— ����� �������� ���������� �������� �� ���������.
— ����� ������ ���������� ����������, �� ����������������� ������ �����������, ����� �������� � ������� ������ ���������.

��������������:
>��������� ����������
��������� ���������� ������.
>��������� �����������
������ ���������� ����������� ������ � ������� ������ �����������.
>��������� ���������� ��� ������� ����������
����������� ��������� ���������� ��� ������� ����������.
����� ����������, �������� ����������, ��� ������� ����������.
����� ���������� �� ����������� ��� �������� ����������.
>����������� ���������
������������� ����������� ��������� ���������� ��� ��������� � ����� ���������� ������, �������� ����������.
����� ���������� ������ �� ����������� ��� ���������� �������������� ���������.

����������:
��������������: ����� ���������� ����������, �������� ���������� �������.
������: ����� ������������ � ��������� ������.
������ (������������) : ����� ������������ � ��������� ������, ����������� �����������.
������ (����): �������������� ����� ���������� �� ���������, �������� ���������� �������.
�������: ����� ������������ � ���������� ������.
������� (������������): ����� ������������ � ���������� ������, ����������� �����������.
������� (����): �������������� ����� ���������� �� ����������, �������� ���������� �������.

* ��������� ������ ���������� ����� �� ��������������� ���������� � ���� ����������� ������������� ����������. ��� �� �������� �������� ����������.

���������� ������ ��������� ����� ������������������� ����������� ��������� ������.

��������� Android: 4.1 � ����
������� ���������: ��

SWFDisplayItem->rotateTo

Rotate» HREF=»/php/007/function.swfdisplayitem.rotate.html»>scale» HREF=»/php/007/function.swfdisplayitem.scale.html»>


����������� �� PHP
����. ����.

SWFDisplayItem->rotateTo

(no version information, might be only in CVS)

SWFDisplayItem->rotateTo — Rotates the object in global coordinates

Description

��� ������� �������� ����������������� . ��������� ���� �������, �� ��� � ����������� � ��� ������������ ����� ���������� � ����������� ������� PHP ��� �����������. ����������� ��� ������� �� ���� ����� � ����.

swfdisplayitem->rotateto() set the current object rotation to degrees degrees in global coordinates.

The object may be a swfshape() , a swfbutton() , a swftext() or a swfsprite() object. It must have been added using the swfmovie->add() .

This example bring three rotating string from the background to the foreground. Pretty nice.

��������

������ 1. swfdisplayitem->rotateto() example

$f = new SWFFont ( «Bauhaus 93.fdb» );

$m = new SWFMovie ();
$m -> setRate ( 24.0 );
$m -> setDimension ( 2400 , 1600 );
$m -> setBackground ( 0xff , 0xff , 0xff );


// functions with huge numbers of arbitrary
// arguments are always a good idea! Really!

function text ( $r , $g , $b , $a , $rot , $x , $y , $scale , $string )
<
global $f , $m ;

$t = new SWFText ();
$t -> setFont ( $f );
$t -> setColor ( $r , $g , $b , $a );
$t -> setHeight ( 960 );
$t -> moveTo (-( $f -> getWidth ( $string ))/ 2 , $f -> getAscent ()/ 2 );
$t -> addString ( $string );

// we can add properties just like a normal PHP var,
// as long as the names aren’t already used.
// e.g., we can’t set $i->scale, because that’s a function

$i = $m -> add ( $t );
$i -> x = $x ;
$i -> y = $y ;
$i -> rot = $rot ;
$i -> s = $scale ;
$i -> rotateTo ( $rot );
$i -> scale ( $scale , $scale );

// but the changes are local to the function, so we have to
// return the changed object. kinda weird..

function step ( $i )
<
$oldrot = $i -> rot ;
$i -> rot = 19 * $i -> rot / 20 ;
$i -> x = ( 19 * $i -> x + 1200 )/ 20 ;
$i -> y = ( 19 * $i -> y + 800 )/ 20 ;
$i -> s = ( 19 * $i -> s + 1.0 )/ 20 ;

$i -> rotateTo ( $i -> rot );
$i -> scaleTo ( $i -> s , $i -> s );
$i -> moveTo ( $i -> x , $i -> y );

// see? it sure paid off in legibility:

$i1 = text ( 0xff , 0x33 , 0x33 , 0xff , 900 , 1200 , 800 , 0.03 , $thetext );
$i2 = text ( 0x00 , 0x33 , 0xff , 0x7f , — 560 , 1200 , 800 , 0.04 , $thetext );
$i3 = text ( 0xff , 0xff , 0xff , 0x9f , 180 , 1200 , 800 , 0.001 , $thetext );

for ( $i = 1 ; $i 100 ; ++ $i ) <
$i1 = step ( $i1 );
$i2 = step ( $i2 );
$i3 = step ( $i3 );

��� ����� ��� swfdisplayitem &#62;rotateto

(no version information, might be only in CVS)

SWFDisplayItem->rotateTo — Rotates the object in global coordinates

Description vo >swfdisplayitem->rotateto ( float degrees )

Эта функция является ЭКСПЕ� ИМЕНТАЛЬНОЙ . Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях PHP без уведомления. Используйте эту функцию на свой страх и риск.

swfdisplayitem->rotateto() set the current object rotation to degrees degrees in global coordinates.

This example bring three rotating string from the background to the foreground. Pretty nice.

Внимание

Пример 1. swfdisplayitem->rotateto() example

$f = new SWFFont ( «Bauhaus 93.fdb» );

$m = new SWFMovie ();
$m -> setRate ( 24.0 );
$m -> setDimension ( 2400 , 1600 );
$m -> setBackground ( 0xff , 0xff , 0xff );

// functions with huge numbers of arbitrary
// arguments are always a good idea! Really!

function text ( $r , $g , $b , $a , $rot , $x , $y , $scale , $string )
<
global $f , $m ;

$t = new SWFText ();
$t -> setFont ( $f );
$t -> setColor ( $r , $g , $b , $a );
$t -> setHeight ( 960 );
$t -> moveTo (-( $f -> getWidth ( $string ))/ 2 , $f -> getAscent ()/ 2 );
$t -> addString ( $string );

// we can add properties just like a normal PHP var,
// as long as the names aren’t already used.
// e.g., we can’t set $i->scale, because that’s a function

$i = $m -> add ( $t );
$i -> x = $x ;
$i -> y = $y ;
$i -> rot = $rot ;
$i -> s = $scale ;
$i -> rotateTo ( $rot );
$i -> scale ( $scale , $scale );


// but the changes are local to the function, so we have to
// return the changed object. kinda weird..

function step ( $i )
<
$oldrot = $i -> rot ;
$i -> rot = 19 * $i -> rot / 20 ;
$i -> x = ( 19 * $i -> x + 1200 )/ 20 ;
$i -> y = ( 19 * $i -> y + 800 )/ 20 ;
$i -> s = ( 19 * $i -> s + 1.0 )/ 20 ;

$i -> rotateTo ( $i -> rot );
$i -> scaleTo ( $i -> s , $i -> s );
$i -> moveTo ( $i -> x , $i -> y );

// see? it sure paid off in legibility:

$i1 = text ( 0xff , 0x33 , 0x33 , 0xff , 900 , 1200 , 800 , 0.03 , $thetext );
$i2 = text ( 0x00 , 0x33 , 0xff , 0x7f , — 560 , 1200 , 800 , 0.04 , $thetext );
$i3 = text ( 0xff , 0xff , 0xff , 0x9f , 180 , 1200 , 800 , 0.001 , $thetext );

for ( $i = 1 ; $i 100 ; ++ $i ) <
$i1 = step ( $i1 );
$i2 = step ( $i2 );
$i3 = step ( $i3 );

header ( ‘Content-type: application/x-shockwave-flash’ );
$m -> output ();
?>

��� ����� ��� swfdisplayitem &#62;rotateto

(no version information, might be only in CVS)

SWFDisplayItem->rotateTo — Rotates the object in global coordinates

Description vo >swfdisplayitem->rotateto ( float degrees )

This function is EXPERIMENTAL . The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.

swfdisplayitem->rotateto() set the current object rotation to degrees degrees in global coordinates.

This example bring three rotating string from the background to the foreground. Pretty nice.

Warning

Example 1. swfdisplayitem->rotateto() example

SWFDisplayItem::rotateTo

Rotates the object in global coordinates

Description

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

swfdisplayitem::rotateto set the current object rotation to angle degrees in global coordinates.

The object may be a swfshape , a swfbutton , a swftext or a swfsprite object. It must have been added using the swfmovie::add .

Return Values

No value is returned.

Examples

This example bring three rotating string from the background to the foreground. Pretty nice.

Example #1 swfdisplayitem::rotateto example

$f = new SWFFont ( «Bauhaus 93.fdb» );


$m = new SWFMovie ();
$m -> setRate ( 24.0 );
$m -> setDimension ( 2400 , 1600 );
$m -> setBackground ( 0xff , 0xff , 0xff );

// functions with huge numbers of arbitrary
// arguments are always a good idea! Really!

function text ( $r , $g , $b , $a , $rot , $x , $y , $scale , $string )
<
global $f , $m ;

$t = new SWFText ();
$t -> setFont ( $f );
$t -> setColor ( $r , $g , $b , $a );
$t -> setHeight ( 960 );
$t -> moveTo (-( $f -> getWidth ( $string ))/ 2 , $f -> getAscent ()/ 2 );
$t -> addString ( $string );

// we can add properties just like a normal PHP var,
// as long as the names aren’t already used.
// e.g., we can’t set $i->scale, because that’s a function

$i = $m -> add ( $t );
$i -> x = $x ;
$i -> y = $y ;
$i -> rot = $rot ;
$i -> s = $scale ;
$i -> rotateTo ( $rot );
$i -> scale ( $scale , $scale );

// but the changes are local to the function, so we have to
// return the changed object. kinda weird..

function step ( $i )
<
$oldrot = $i -> rot ;
$i -> rot = 19 * $i -> rot / 20 ;
$i -> x = ( 19 * $i -> x + 1200 )/ 20 ;
$i -> y = ( 19 * $i -> y + 800 )/ 20 ;
$i -> s = ( 19 * $i -> s + 1.0 )/ 20 ;

$i -> rotateTo ( $i -> rot );
$i -> scaleTo ( $i -> s , $i -> s );
$i -> moveTo ( $i -> x , $i -> y );

// see? it sure paid off in legibility:

$i1 = text ( 0xff , 0x33 , 0x33 , 0xff , 900 , 1200 , 800 , 0.03 , $thetext );
$i2 = text ( 0x00 , 0x33 , 0xff , 0x7f , — 560 , 1200 , 800 , 0.04 , $thetext );
$i3 = text ( 0xff , 0xff , 0xff , 0x9f , 180 , 1200 , 800 , 0.001 , $thetext );

for ( $i = 1 ; $i 100 ; ++ $i ) <
$i1 = step ( $i1 );
$i2 = step ( $i2 );
$i3 = step ( $i3 );

header ( ‘Content-type: application/x-shockwave-flash’ );
$m -> output ();
?>

SWFDisplayItem->rotateTo

(No version information available, might be only in CVS)

SWFDisplayItem->rotateTo � Rotates the object in global coordinates

Description

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

swfdisplayitem->rotateto() set the current object rotation to angle degrees in global coordinates.

The object may be a swfshape(), a swfbutton(), a swftext() or a swfsprite() object. It must have been added using the swfmovie->add().

Return Values

No value is returned.

Examples

This example bring three rotating string from the background to the foreground. Pretty nice.

Example #1 swfdisplayitem->rotateto() example

$f = new SWFFont ( «Bauhaus 93.fdb» );

$m = new SWFMovie ();
$m -> setRate ( 24.0 );
$m -> setDimension ( 2400 , 1600 );
$m -> setBackground ( 0xff , 0xff , 0xff );


// functions with huge numbers of arbitrary
// arguments are always a good idea! Really!

function text ( $r , $g , $b , $a , $rot , $x , $y , $scale , $string )
<
global $f , $m ;

$t = new SWFText ();
$t -> setFont ( $f );
$t -> setColor ( $r , $g , $b , $a );
$t -> setHeight ( 960 );
$t -> moveTo (-( $f -> getWidth ( $string ))/ 2 , $f -> getAscent ()/ 2 );
$t -> addString ( $string );

// we can add properties just like a normal PHP var,
// as long as the names aren’t already used.
// e.g., we can’t set $i->scale, because that’s a function

$i = $m -> add ( $t );
$i -> x = $x ;
$i -> y = $y ;
$i -> rot = $rot ;
$i -> s = $scale ;
$i -> rotateTo ( $rot );
$i -> scale ( $scale , $scale );

// but the changes are local to the function, so we have to
// return the changed object. kinda weird..

function step ( $i )
<
$oldrot = $i -> rot ;
$i -> rot = 19 * $i -> rot / 20 ;
$i -> x = ( 19 * $i -> x + 1200 )/ 20 ;
$i -> y = ( 19 * $i -> y + 800 )/ 20 ;
$i -> s = ( 19 * $i -> s + 1.0 )/ 20 ;

$i -> rotateTo ( $i -> rot );
$i -> scaleTo ( $i -> s , $i -> s );
$i -> moveTo ( $i -> x , $i -> y );

// see? it sure paid off in legibility:

$i1 = text ( 0xff , 0x33 , 0x33 , 0xff , 900 , 1200 , 800 , 0.03 , $thetext );
$i2 = text ( 0x00 , 0x33 , 0xff , 0x7f , — 560 , 1200 , 800 , 0.04 , $thetext );
$i3 = text ( 0xff , 0xff , 0xff , 0x9f , 180 , 1200 , 800 , 0.001 , $thetext );

for ( $i = 1 ; $i 100 ; ++ $i ) <
$i1 = step ( $i1 );
$i2 = step ( $i2 );
$i3 = step ( $i3 );

header ( ‘Content-type: application/x-shockwave-flash’ );
$m -> output ();
?>

SWFDisplayItem::rotateTo

(PHP 5 SWFDisplayItem::rotateTo � Rotates the object in global coordinates

Description

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

swfdisplayitem::rotateto() set the current object rotation to angle degrees in global coordinates.

The object may be a swfshape() , a swfbutton() , a swftext() or a swfsprite() object. It must have been added using the swfmovie::add() .

Return Values

No value is returned.

Examples

This example bring three rotating string from the background to the foreground. Pretty nice.

Example #1 swfdisplayitem::rotateto() example

$f = new SWFFont ( «Bauhaus 93.fdb» );

$m = new SWFMovie ();
$m -> setRate ( 24.0 );
$m -> setDimension ( 2400 , 1600 );
$m -> setBackground ( 0xff , 0xff , 0xff );

// functions with huge numbers of arbitrary
// arguments are always a good idea! Really!

function text ( $r , $g , $b , $a , $rot , $x , $y , $scale , $string )
<
global $f , $m ;


$t = new SWFText ();
$t -> setFont ( $f );
$t -> setColor ( $r , $g , $b , $a );
$t -> setHeight ( 960 );
$t -> moveTo (-( $f -> getWidth ( $string ))/ 2 , $f -> getAscent ()/ 2 );
$t -> addString ( $string );

// we can add properties just like a normal PHP var,
// as long as the names aren’t already used.
// e.g., we can’t set $i->scale, because that’s a function

$i = $m -> add ( $t );
$i -> x = $x ;
$i -> y = $y ;
$i -> rot = $rot ;
$i -> s = $scale ;
$i -> rotateTo ( $rot );
$i -> scale ( $scale , $scale );

// but the changes are local to the function, so we have to
// return the changed object. kinda weird..

function step ( $i )
<
$oldrot = $i -> rot ;
$i -> rot = 19 * $i -> rot / 20 ;
$i -> x = ( 19 * $i -> x + 1200 )/ 20 ;
$i -> y = ( 19 * $i -> y + 800 )/ 20 ;
$i -> s = ( 19 * $i -> s + 1.0 )/ 20 ;

$i -> rotateTo ( $i -> rot );
$i -> scaleTo ( $i -> s , $i -> s );
$i -> moveTo ( $i -> x , $i -> y );

// see? it sure paid off in legibility:

$i1 = text ( 0xff , 0x33 , 0x33 , 0xff , 900 , 1200 , 800 , 0.03 , $thetext );
$i2 = text ( 0x00 , 0x33 , 0xff , 0x7f , — 560 , 1200 , 800 , 0.04 , $thetext );
$i3 = text ( 0xff , 0xff , 0xff , 0x9f , 180 , 1200 , 800 , 0.001 , $thetext );

for ( $i = 1 ; $i 100 ; ++ $i ) <
$i1 = step ( $i1 );
$i2 = step ( $i2 );
$i3 = step ( $i3 );

header ( ‘Content-type: application/x-shockwave-flash’ );
$m -> output ();
?>

SWFDisplayItem::rotateTo

(PHP 5 SWFDisplayItem::rotateTo � Rotates the object in global coordinates

Description

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

swfdisplayitem::rotateto() set the current object rotation to angle degrees in global coordinates.

The object may be a swfshape() , a swfbutton() , a swftext() or a swfsprite() object. It must have been added using the swfmovie::add() .

Return Values

No value is returned.

Examples

This example bring three rotating string from the background to the foreground. Pretty nice.

Example #1 swfdisplayitem::rotateto() example

$f = new SWFFont ( «Bauhaus 93.fdb» );

$m = new SWFMovie ();
$m -> setRate ( 24.0 );
$m -> setDimension ( 2400 , 1600 );
$m -> setBackground ( 0xff , 0xff , 0xff );

// functions with huge numbers of arbitrary
// arguments are always a good idea! Really!

function text ( $r , $g , $b , $a , $rot , $x , $y , $scale , $string )
<
global $f , $m ;

$t = new SWFText ();
$t -> setFont ( $f );
$t -> setColor ( $r , $g , $b , $a );
$t -> setHeight ( 960 );
$t -> moveTo (-( $f -> getWidth ( $string ))/ 2 , $f -> getAscent ()/ 2 );
$t -> addString ( $string );

// we can add properties just like a normal PHP var,
// as long as the names aren’t already used.
// e.g., we can’t set $i->scale, because that’s a function

$i = $m -> add ( $t );
$i -> x = $x ;
$i -> y = $y ;
$i -> rot = $rot ;
$i -> s = $scale ;
$i -> rotateTo ( $rot );
$i -> scale ( $scale , $scale );


// but the changes are local to the function, so we have to
// return the changed object. kinda weird..

function step ( $i )
<
$oldrot = $i -> rot ;
$i -> rot = 19 * $i -> rot / 20 ;
$i -> x = ( 19 * $i -> x + 1200 )/ 20 ;
$i -> y = ( 19 * $i -> y + 800 )/ 20 ;
$i -> s = ( 19 * $i -> s + 1.0 )/ 20 ;

$i -> rotateTo ( $i -> rot );
$i -> scaleTo ( $i -> s , $i -> s );
$i -> moveTo ( $i -> x , $i -> y );

// see? it sure paid off in legibility:

$i1 = text ( 0xff , 0x33 , 0x33 , 0xff , 900 , 1200 , 800 , 0.03 , $thetext );
$i2 = text ( 0x00 , 0x33 , 0xff , 0x7f , — 560 , 1200 , 800 , 0.04 , $thetext );
$i3 = text ( 0xff , 0xff , 0xff , 0x9f , 180 , 1200 , 800 , 0.001 , $thetext );

for ( $i = 1 ; $i 100 ; ++ $i ) <
$i1 = step ( $i1 );
$i2 = step ( $i2 );
$i3 = step ( $i3 );

header ( ‘Content-type: application/x-shockwave-flash’ );
$m -> output ();
?>

swfdisplayitem.rotateto — ������� PHP

(no version information, might be only in CVS)

SWFDisplayItem->rotateTo — Rotates the object in global coordinates

Description

��� ������� �������� ����������������� . ��������� ���� �������, �� ��� � ����������� � ��� ������������ ����� ���������� � ����������� ������� PHP ��� �����������. ����������� ��� ������� �� ���� ����� � ����.

swfdisplayitem->rotateto() set the current object rotation to degrees degrees in global coordinates.

The object may be a swfshape() , a swfbutton() , a swftext() or a swfsprite() object. It must have been added using the swfmovie->add() .

This example bring three rotating string from the background to the foreground. Pretty nice.

��������

������ 1. swfdisplayitem->rotateto() example

$f = new SWFFont ( «Bauhaus 93.fdb» );

$m = new SWFMovie ();
$m -> setRate ( 24.0 );
$m -> setDimension ( 2400 , 1600 );
$m -> setBackground ( 0xff , 0xff , 0xff );

// functions with huge numbers of arbitrary
// arguments are always a good idea! Really!

function text ( $r , $g , $b , $a , $rot , $x , $y , $scale , $string )
<
global $f , $m ;

$t = new SWFText ();
$t -> setFont ( $f );
$t -> setColor ( $r , $g , $b , $a );
$t -> setHeight ( 960 );
$t -> moveTo (-( $f -> getWidth ( $string ))/ 2 , $f -> getAscent ()/ 2 );
$t -> addString ( $string );

// we can add properties just like a normal PHP var,
// as long as the names aren’t already used.
// e.g., we can’t set $i->scale, because that’s a function

$i = $m -> add ( $t );
$i -> x = $x ;
$i -> y = $y ;
$i -> rot = $rot ;
$i -> s = $scale ;
$i -> rotateTo ( $rot );
$i -> scale ( $scale , $scale );

// but the changes are local to the function, so we have to
// return the changed object. kinda weird..

function step ( $i )
<
$oldrot = $i -> rot ;
$i -> rot = 19 * $i -> rot / 20 ;
$i -> x = ( 19 * $i -> x + 1200 )/ 20 ;
$i -> y = ( 19 * $i -> y + 800 )/ 20 ;
$i -> s = ( 19 * $i -> s + 1.0 )/ 20 ;

$i -> rotateTo ( $i -> rot );
$i -> scaleTo ( $i -> s , $i -> s );
$i -> moveTo ( $i -> x , $i -> y );


// see? it sure paid off in legibility:

$i1 = text ( 0xff , 0x33 , 0x33 , 0xff , 900 , 1200 , 800 , 0.03 , $thetext );
$i2 = text ( 0x00 , 0x33 , 0xff , 0x7f , — 560 , 1200 , 800 , 0.04 , $thetext );
$i3 = text ( 0xff , 0xff , 0xff , 0x9f , 180 , 1200 , 800 , 0.001 , $thetext );

for ( $i = 1 ; $i 100 ; ++ $i ) <
$i1 = step ( $i1 );
$i2 = step ( $i2 );
$i3 = step ( $i3 );

SWFDisplayItem::rotateTo

SWFDisplayItem::rotateTo � Rotates the object in global coordinates

��������

��� ������� �������� �����������������. ��������� ���� �������, �� ��� � ����������� � ��� ������������ ����� ���������� � ����������� ������� PHP ��� �����������. ����������� ��� ������� �� ���� ����� � ����.

swfdisplayitem::rotateto() set the current object rotation to angle degrees in global coordinates.

The object may be a swfshape() , a swfbutton() , a swftext() or a swfsprite() object. It must have been added using the swfmovie::add() .

������������ ��������

��� ������� �� ���������� �������� ����� ����������.

�������

This example bring three rotating string from the background to the foreground. Pretty nice.

������ #1 swfdisplayitem::rotateto() example

$f = new SWFFont ( «Bauhaus 93.fdb» );

$m = new SWFMovie ();
$m -> setRate ( 24.0 );
$m -> setDimension ( 2400 , 1600 );
$m -> setBackground ( 0xff , 0xff , 0xff );

// functions with huge numbers of arbitrary
// arguments are always a good idea! Really!

function text ( $r , $g , $b , $a , $rot , $x , $y , $scale , $string )
<
global $f , $m ;

$t = new SWFText ();
$t -> setFont ( $f );
$t -> setColor ( $r , $g , $b , $a );
$t -> setHeight ( 960 );
$t -> moveTo (-( $f -> getWidth ( $string ))/ 2 , $f -> getAscent ()/ 2 );
$t -> addString ( $string );

// we can add properties just like a normal PHP var,
// as long as the names aren’t already used.
// e.g., we can’t set $i->scale, because that’s a function

$i = $m -> add ( $t );
$i -> x = $x ;
$i -> y = $y ;
$i -> rot = $rot ;
$i -> s = $scale ;
$i -> rotateTo ( $rot );
$i -> scale ( $scale , $scale );

// but the changes are local to the function, so we have to
// return the changed object. kinda weird..

function step ( $i )
<
$oldrot = $i -> rot ;
$i -> rot = 19 * $i -> rot / 20 ;
$i -> x = ( 19 * $i -> x + 1200 )/ 20 ;
$i -> y = ( 19 * $i -> y + 800 )/ 20 ;
$i -> s = ( 19 * $i -> s + 1.0 )/ 20 ;

$i -> rotateTo ( $i -> rot );
$i -> scaleTo ( $i -> s , $i -> s );
$i -> moveTo ( $i -> x , $i -> y );

// see? it sure paid off in legibility:

$i1 = text ( 0xff , 0x33 , 0x33 , 0xff , 900 , 1200 , 800 , 0.03 , $thetext );
$i2 = text ( 0x00 , 0x33 , 0xff , 0x7f , — 560 , 1200 , 800 , 0.04 , $thetext );
$i3 = text ( 0xff , 0xff , 0xff , 0x9f , 180 , 1200 , 800 , 0.001 , $thetext );

for ( $i = 1 ; $i 100 ; ++ $i ) <
$i1 = step ( $i1 );
$i2 = step ( $i2 );
$i3 = step ( $i3 );

header ( ‘Content-type: application/x-shockwave-flash’ );
$m -> output ();
?>

Илон Маск рекомендует:  Типы графики
Понравилась статья? Поделиться с друзьями:
Кодинг, CSS и SQL