Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   Искажение динамического текста (http://www.flasher.ru/forum/showthread.php?t=101853)

O.K. 04.10.2007 11:01

Искажение динамического текста
 
Вложений: 1
Каким образом сделать чтоб текст отображался, или как исказить его другим способом?

aksios 04.10.2007 11:32

Цитата:

...чтоб текст отображался, или как исказить его другим способом?
- Юмор на флешере.

iNils 04.10.2007 11:36

Шрифт надо эмбедить (embed).

O.K. 04.10.2007 11:38

Всмысле юмор?

Код:

import flash.filters.DisplacementMapFilter;
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Matrix;
import flash.geom.ColorTransform;

var filteredMc:MovieClip = createDisplacementMapRectangle();

filteredMc.onPress = function() {
    var filter:DisplacementMapFilter = this.filters[0];
    filter.mapPoint = new Point(-30, -40);
    this.filters = new Array(filter);
    this._x = 30;
    this._y = 40;
}

function createDisplacementMapRectangle():MovieClip {
    var mapBitmap:BitmapData = createGradientBitmap(300, 80, 0xFF000000, "radial");
    var filter:DisplacementMapFilter = new DisplacementMapFilter(mapBitmap, new Point(-30, -30), 1, 1, 10, 10, "wrap", 0x000000, 0x000000);

    var txtBlock:MovieClip = createTextBlock();
    txtBlock._x = 30;
    txtBlock._y = 30;
   
    txtBlock.filters = new Array(filter);

    return txtBlock;
}

function createGradientBitmap(w:Number, h:Number, bgColor:Number, type:String, hide:Boolean):BitmapData {
    var mc:MovieClip = this.createEmptyMovieClip("mc", 1);
    var matrix:Matrix = new Matrix();
    matrix.createGradientBox(w, h, 0, 0, 0);

    mc.beginGradientFill(type, [0xFF0000, 0x0000FF], [100, 100], [0x55, 0x99], matrix, "pad");
    mc.lineTo(w, 0);
    mc.lineTo(w, h);
    mc.lineTo(0, h);
    mc.lineTo(0, 0);
    mc.endFill();
    (hide == true) ? mc._alpha = 0 : mc._alpha = 100;
   
    var bmp:BitmapData = new BitmapData(w, h, true, bgColor);
        bmp.draw(mc, new Matrix(), new ColorTransform(), "normal", bmp.rectangle, true);
    mc.attachBitmap(bmp, this.getNextHighestDepth());
   
    return bmp;
}

function createTextBlock():MovieClip {
    var txtBlock:MovieClip = this.createEmptyMovieClip("txtBlock", this.getNextHighestDepth());
    txtBlock.createTextField("txt", this.getNextHighestDepth(), 0, 0, 300, 80);
    txtBlock.txt.text = "watch the text bend with the displacement map";
    return txtBlock;
}

Это я нашел в helpe, но разобраться и сделать то что я хочу знаний не хватает.

Цитата:

Шрифт надо эмбедить (embed).
-Спасибо!

aQuestion 04.10.2007 17:56

Цитата:

Сообщение от O.K.
Это я нашел в helpe, но разобраться и сделать то что я хочу знаний не хватает.

Компенсируйте нехватку знаний деньгами.

З.ы.


Часовой пояс GMT +4, время: 09:41.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.