当前位置: 首页>>代码示例>>PHP>>正文


PHP float::getRotation方法代码示例

本文整理汇总了PHP中float::getRotation方法的典型用法代码示例。如果您正苦于以下问题:PHP float::getRotation方法的具体用法?PHP float::getRotation怎么用?PHP float::getRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在float的用法示例。


在下文中一共展示了float::getRotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderText

 /**
  * Render text depending of font type and available font extensions
  * 
  * @param string $id 
  * @param string $text 
  * @param string $chars 
  * @param int $type 
  * @param string $path 
  * @param ezcGraphColor $color 
  * @param ezcGraphCoordinate $position 
  * @param float $size 
  * @param float $rotation 
  * @return void
  */
 protected function renderText($id, $text, $chars, $type, $path, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null)
 {
     $movie = $this->getDocument();
     $tb = new SWFTextField(SWFTEXTFIELD_NOEDIT);
     $tb->setFont(new SWFFont($path));
     $tb->setHeight($size);
     $tb->setColor($color->red, $color->green, $color->blue, 255 - $color->alpha);
     $tb->addString($text);
     $tb->addChars($chars);
     $object = $movie->add($tb);
     $object->rotate($rotation !== null ? -$rotation->getRotation() : 0);
     $object->moveTo($position->x + ($rotation === null ? 0 : $this->modifyCoordinate($rotation->get(0, 2))), $position->y - $size * (1 + $this->options->lineSpacing) + ($rotation === null ? 0 : $this->modifyCoordinate($rotation->get(1, 2))));
     $object->setName($id);
 }
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:28,代码来源:flash.php

示例2: renderText

 /**
  * Render text depending of font type and available font extensions
  * 
  * @param string $id 
  * @param string $text 
  * @param string $font 
  * @param ezcGraphColor $color 
  * @param ezcGraphCoordinate $position 
  * @param float $size 
  * @param float $rotation 
  * @return void
  */
 protected function renderText($text, $font, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null)
 {
     $this->context->selectFontFace($font, CairoFontSlant::NORMAL, CairoFontWeight::NORMAL);
     $this->context->setFontSize($size);
     // Store current state of context
     $this->context->save();
     $this->context->moveTo(0, 0);
     if ($rotation !== null) {
         // Move to the center
         $this->context->translate($rotation->getCenter()->x, $rotation->getCenter()->y);
         // Rotate around text center
         $this->context->rotate(deg2rad($rotation->getRotation()));
         // Center the text
         $this->context->translate($position->x - $rotation->getCenter()->x, $position->y - $rotation->getCenter()->y - $size * 0.15);
     } else {
         $this->context->translate($position->x, $position->y - $size * 0.15);
     }
     $this->context->newPath();
     $this->getStyle($color, true);
     $this->context->showText($text);
     $this->context->stroke();
     // Restore state of context
     $this->context->restore();
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:36,代码来源:cairo_oo.php

示例3: renderText

 /**
  * Render text depending of font type and available font extensions
  * 
  * @param string $id 
  * @param string $text 
  * @param string $font 
  * @param ezcGraphColor $color 
  * @param ezcGraphCoordinate $position 
  * @param float $size 
  * @param float $rotation 
  * @return void
  */
 protected function renderText($text, $font, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null)
 {
     cairo_select_font_face($this->context, $font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size($this->context, $size);
     // Store current state of context
     cairo_save($this->context);
     cairo_move_to($this->context, 0, 0);
     if ($rotation !== null) {
         // Move to the center
         cairo_translate($this->context, $rotation->getCenter()->x, $rotation->getCenter()->y);
         // Rotate around text center
         cairo_rotate($this->context, deg2rad($rotation->getRotation()));
         // Center the text
         cairo_translate($this->context, $position->x - $rotation->getCenter()->x, $position->y - $rotation->getCenter()->y - $size * 0.15);
     } else {
         cairo_translate($this->context, $position->x, $position->y - $size * 0.15);
     }
     cairo_new_path($this->context);
     $this->getStyle($color, true);
     cairo_show_text($this->context, $text);
     cairo_stroke($this->context);
     // Restore state of context
     cairo_restore($this->context);
 }
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:36,代码来源:cairo.php


注:本文中的float::getRotation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。