SommaireTelecharger la documentationChapitre suivantChapitre precedent  

  .: News :.: Edito :.: Scripts :.: Forum :.: Erreurs :.: Jobs :. 
 
Sommaire

Ming pour Flash

Introduction
Installation
Comment utiliser Ming
SWFMovie
SWFMovie->output
SWFMovie->save
SWFMovie->add
SWFMovie->remove
SWFMovie->setbackground
SWFMovie->setrate
SWFMovie->setdimension
SWFMovie->setframes
SWFMovie->nextframe
SWFMovie->streammp3
SWFDisplayItem
SWFDisplayItem->moveTo
SWFDisplayItem->move
SWFDisplayItem->scaleTo
SWFDisplayItem->scale
SWFDisplayItem->rotateTo
SWFDisplayItem->Rotate
SWFDisplayItem->skewXTo
SWFDisplayItem->skewX
SWFDisplayItem->skewYTo
SWFDisplayItem->skewY
SWFDisplayItem->setDepth
SWFDisplayItem->remove
SWFDisplayItem->setName
SWFDisplayItem->setRatio
SWFDisplayItem->addColor
SWFDisplayItem->multColor
SWFShape
SWFShape->setLine
SWFShape->addFill
SWFShape->setLeftFill
SWFShape->setRightFill
SWFShape->movePenTo
SWFShape->movePen
SWFShape->drawLineTo
SWFShape->drawLine
SWFShape->drawCurveTo
SWFShape->drawCurve
SWFGradient
SWFGradient->addEntry
SWFBitmap
SWFBitmap->getWidth
SWFBitmap->getHeight
SWFFill
SWFFill->moveTo
SWFFill->scaleTo
SWFFill->rotateTo
SWFFill->skewXTo
SWFFill->skewYTo
SWFMorph
SWFMorph->getshape1
SWFMorph->getshape2
SWFText
SWFText->setFont
SWFText->setHeight
SWFText->setSpacing
SWFText->setColor
SWFText->moveTo
SWFText->addString
SWFText->getWidth
SWFFont
swffont->getwidth
SWFTextField
SWFTextField->setFont
SWFTextField->setbounds
SWFTextField->align
SWFTextField->setHeight
SWFTextField->setLeftMargin
SWFTextField->setrightMargin
SWFTextField->setMargins
SWFTextField->setindentation
SWFTextField->setLineSpacing
SWFTextField->setcolor
SWFTextField->setname
SWFTextField->addstring
SWFSprite
SWFSprite->add
SWFSprite->remove
SWFSprite->setframes
SWFSprite->nextframe
SWFbutton
SWFbutton->addShape
SWFbutton->setUp
SWFbutton->setOver
SWFbutton->setDown
SWFbutton->setHit
SWFbutton->addAction
SWFbutton->setAction
SWFAction

6.57.20 SWFDisplayItem->rotateTo

[ Exemples avec SWFDisplayItem->rotateTo ]  

Description

void swfdisplayitem->rotateto(double degrees )

swfdisplayitem->rotateto tourne l'objet jusqu'à l'angle absoludegrees, 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(24001600);
  
$m->setBackground(0xff0xff0xff);
  
// Les fonctions avec un nombre d'arguments sont vraiment une bonne idées.
  // 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 utilisez $i->scale, car c'est une fonction.
    
$i $m->add($t);
    
$i->$x;
    
$i->$y;
    
$i->rot $rot;
    
$i->$scale;
    
$i->rotateTo($rot);
    
$i->scale($scale$scale);
    
// mais les modification 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->= (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;
  }
  
// Alors? Ça valait la peine, non?
  
$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();
?>

Voir aussi swfdisplayitem->rotate.


Chapitre précédentChapitre suivantAccueil nexen.net