SWFDisplayItem->Rotate
<<<
SWFDisplayItem->rotateTo SWFDisplayItem->scale
>>>

6.21 Ming pour Flash
6 Référence des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes pré-définies
Classes pré-définies
ming_keypress
ming_setcubicthreshold
ming_setscale
ming_useConstants
ming_useswfversion
SWFAction
SWFBitmap->getHeight
SWFBitmap->getWidth
SWFBitmap
SWFbutton->addAction
SWFButton::addASound
SWFbutton->addShape
SWFbutton->setAction
SWFbutton->setdown
SWFbutton->setHit
SWFButton::setMenu
SWFbutton->setOver
SWFbutton->setUp
SWFbutton
SWFDisplayItem::addAction
SWFDisplayItem->addColor
SWFDisplayItem::endMask
SWFDisplayItem::getRot
SWFDisplayItem::getX
SWFDisplayItem::getXScale
SWFDisplayItem::getXSkew
SWFDisplayItem::getY
SWFDisplayItem::getYScale
SWFDisplayItem::getYSkew
SWFDisplayItem->move
SWFDisplayItem->moveTo
SWFDisplayItem->multColor
SWFDisplayItem->remove
SWFDisplayItem->Rotate
->SWFDisplayItem->rotateTo
SWFDisplayItem->scale
SWFDisplayItem->scaleTo
SWFDisplayItem->setDepth
SWFDisplayItem::setMaskLevel
SWFDisplayItem::setMatrix
SWFDisplayItem->setName
SWFDisplayItem->setRatio
SWFDisplayItem->skewX
SWFDisplayItem->skewXTo
SWFDisplayItem->skewY
SWFDisplayItem->skewYTo
SWFFill->moveTo
SWFFill->rotateTo
SWFFill->scaleTo
SWFFill->skewXTo
SWFFill->skewYTo
SWFFill
SWFFont::getAscent
SWFFont::getDescent
SWFFont::getLeading
SWFFont::getShape
SWFFont::getUTF8Width
swffont->getwidth
SWFFont
SWFFontChar::addChars
SWFFontChar::addUTF8Chars
SWFGradient->addEntry
SWFGradient
SWFMorph->getshape1
SWFMorph->getshape2
SWFMorph
SWFMovie->add
SWFMovie::addExport
SWFMovie::addFont
SWFMovie::importChar
SWFMovie::importFont
SWFMovie::labelFrame
SWFMovie->nextframe
SWFMovie->output
swfmovie->remove
SWFMovie->save
SWFMovie::saveToFile
SWFMovie->setbackground
SWFMovie->setdimension
SWFMovie->setframes
SWFMovie->setrate
SWFMovie::startSound
SWFMovie::stopSound
SWFMovie->streammp3
SWFMovie::writeExports
SWFMovie
SWFPrebuiltClip
SWFShape->addFill
SWFShape::drawArc
SWFShape::drawCircle
SWFShape::drawCubic
SWFShape::drawCubicTo
SWFShape->drawCurve
SWFShape->drawCurveTo
SWFShape::drawGlyph
SWFShape->drawLine
SWFShape->drawLineTo
SWFShape->movePen
SWFShape->movePenTo
SWFShape->setLeftFill
SWFShape->setLine
SWFShape->setRightFill
SWFShape
SWFSound
SWFSoundInstance::loopCount
SWFSoundInstance::loopInPoint
SWFSoundInstance::loopOutPoint
SWFSoundInstance::noMultiple
swfsprite->add
SWFSprite::labelFrame
SWFSprite->nextframe
SWFSprite->remove
SWFSprite->setframes
SWFSprite::startSound
SWFSprite::stopSound
SWFSprite
SWFText->addString
SWFText::addUTF8String
SWFText::getAscent
SWFText::getDescent
SWFText::getLeading
SWFText::getUTF8Width
SWFText->getWidth
SWFText->moveTo
SWFText->setColor
SWFText->setFont
SWFText->setHeight
SWFText->setSpacing
SWFText
SWFTextField::addChars
SWFTextField->addstring
SWFTextField->align
SWFTextField->setbounds
SWFTextField->setcolor
SWFTextField->setFont
SWFTextField->setHeight
SWFTextField->setindentation
SWFTextField->setLeftMargin
SWFTextField->setLineSpacing
SWFTextField->setMargins
SWFTextField->setname
SWFTextField::setPadding
SWFTextField->setrightMargin
SWFTextField
SWFVideoStream::getNumFrames
SWFVideoStream::setDimension
SWFVideoStream

6.21.42 SWFDisplayItem->rotateTo()Tourne un objet en angle absolu

[ Exemples avec swfdisplayitem.rotateto ]   CVS uniquement

void  swfdisplayitem->rotateto ( float   degrees )
Attention

Cette fonction est EXPERIMENTALE . Cela signifie que le comportement de cette fonction, son nom et concrètement, TOUT ce qui est documenté ici peut changer dans un futur proche, SANS PREAVIS! Soyez-en conscient, et utilisez cette fonction à vos risques et périls.

SWFDisplayItem->rotateTo tourne l'objet jusqu'à l'angle absolu degrees , en degrés.

L'objet peut être swfshape , swfbutton , swftext ou swfsprite . Il doit avoir été ajouté à une animation avec la fonction swfmovie->add .

Cet exemple amène trois chaînes tournoyantes depuis le fond de l'écran. Plutôt sympa.
Exemple avec SWFDisplayItem->rotateTo

<?php
$thetext
=  "ming!";
$f = new SWFFont("Bauhaus 93.fdb");
$m = new SWFMovie();
$m->setRate(24.0);
$m->setDimension(2400, 1600);
$m->setBackground(0xff, 0xff, 0xff);
// Les fonctions avec un nombre d'arguments sont vraiment une bonne idée.
// Sincèrement!
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);
  
// On peut ajouter des propriétés comme pour une variable PHP standard
  // tant que les noms ne sont pas déjà pris.
  // e.g., vous ne pouvez pas utiliser $i->scale, car c'est une fonction.
  
$i = $m->add($t);
  
$i->x = $x;
  
$i->y = $y;
  
$i->rot = $rot;
  
$i->s = $scale;
  
$i->rotateTo($rot);
  
$i->scale($scale, $scale);
  
// mais les modifications sont locales à une fonction, donc il faut
  // retourner l'objet modifié. Pas pratique...
  
return $i;
}
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);
  return
$i;
}
// Alors? &Ccedil;a valait la peine, non?
$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);
  
$m->nextFrame();
}
header('Content-type: application/x-shockwave-flash');
$m->output();
?>

Voir aussi swfdisplayitem->rotate .

<< SWFDisplayItem->rotateTo >>
SWFDisplayItem->Rotate Ming pour Flash SWFDisplayItem->scale