Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

Rechercher une fonction PHP

SWFDisplayItem::rotateTo

(PHP 5 < 5.3.0, PECL ming SVN)

SWFDisplayItem::rotateToRotates the object in global coordinates

Description

SWFDisplayItem::rotateTo ( float $angle ) : void
Warning

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().

Eerste pagina van Manuel PHP  Inhoudsopgave Haut

Return Values

No value is returned.

Eerste pagina van Manuel PHP  Inhoudsopgave Haut

Examples

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

Example #1 swfdisplayitem::rotateto() example

<?php
$thetext 
=  "ming!";

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

$m = new SWFMovie();
$m->setRate(24.0);
$m->setDimension(24001600);
$m->setBackground(0xff0xff0xff);

// 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;
  
$i->$y;
  
$i->rot $rot;
  
$i->$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..

  
return $i;
}

function 
step($i
{
  
$oldrot $i->rot;
  
$i->rot 19*$i->rot/20;
  
$i->= (19*$i->1200)/20;
  
$i->= (19*$i->800)/20;
  
$i->= (19*$i->1.0)/20;

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

  return 
$i;
}

// see?  it sure paid off in legibility:

$i1 text(0xff0x330x330xff90012008000.03$thetext);
$i2 text(0x000x330xff0x7f, -56012008000.04$thetext);
$i3 text(0xff0xff0xff0x9f18012008000.001$thetext);

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

  
$m->nextFrame();
}

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

Eerste pagina van Manuel PHP  Inhoudsopgave Haut

See Also

Zoek een PHP-functie

Vertaling niet beschikbaar

De PHP-handleiding is nog niet in het Nederlands vertaald, dus het scherm is in het Engels. Als u wilt, kunt u het ook in het Frans of in het Duits raadplegen.

Als je de moed voelt, kun je je vertaling aanbieden ;-)

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 30/01/2003 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/php-rf-swfdisplayitem.rotateto.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : http://php.net

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut