FIVe3Dで好きなフォントを使う(日本語も)

FIVe3Dについての前回誤解していた事があったので補足。
日本語は使えます。というか好きなフォント使えます。素晴らしい!
English Onlyって書いてすんません。
フォント1つにつきクラスを1つ作成するんですが、そのクラス生成ファイルを用意してくれてた!
前回の記事にコメントで指摘してもらったんですが、
Additional DownloadとしてMake a new typographyというswfがダウンロードできます。
FIve3Dの公式サイトから

使い方
ダウンロードしたMake a new typography file.swfを

  • WindowSWFフォルダにいれます。
  • マックだと/user/XXXX/Application Support/Adobe/FlashCS3/ja/Configrationという場所にあります。
  • Flashを起動。(起動済みなら再起動)
  • 新規ドキュメント作って保存して、window>その他のパネルからMake a new Typographyを開く

で以下のような画面になるので、書き出したいクラス名、クラスに書き出したいフォント、使いたい文字(デフォルトでは英数と記号)。を設定。

で書き出されたクラスファイルをFIVe3Dのtypographyパッケージの中へ入れて使うって感じです。

*Fontが自由だと表現の幅が広がってGood
*日本語の場合、使いたい文字をクラス毎に指定しないと行けないので、すこし面倒かもですね。
*日本語フォントの全部の文字を埋め込んだクラスを作るとヤバいかな。。。
*フォントのライセンスに気をつけましょう注意書きがあるので、気をつけましょう。
*パネルに日本語埋め込むときコピペでないとうまく日本語入力できなかったです。

参考までにソース

package {

	import flash.display.StageScaleMode;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;

	// We import the FIVe3D classes needed.
	import five3D.display.DynamicText3D;
	import five3D.display.Scene3D;
	import five3D.display.Shape3D;
	import five3D.display.Sprite3D;
	import five3D.typography.HiraginoMinchoW6;
	import five3D.typography.HiraginoGothicW6;
	import five3D.typography.Georgia;
	import five3D.utils.Drawing;

	public class FiveTest02 extends Sprite {

		private var scene:Scene3D
		private var tf01:DynamicText3D
		private var tf02:DynamicText3D
		private var tf03:DynamicText3D

		public function FiveTest02() {

			makeScene();
			makeObject3D_01()
			makeObject3D_02()
			makeObject3D_03()
			this.addEventListener(Event.ENTER_FRAME, enterFrameHandler)
		}

		private function makeScene(){
			scene = new Scene3D();
			scene.x = 300;
			scene.y = 200;
			addChild(scene);
		}

		private function makeObject3D_01(){
			tf01 = new DynamicText3D();
			tf01.typography = five3D.typography.HiraginoGothicW6;
			tf01.size = 50;
			tf01.color = 0xBBBBBB;
			tf01.text = "ヒラギノ角ゴシック";
			tf01.x = -70;
			tf01.y = 100;
			tf01.rotationZ = -30;
			tf01.rotationY = -70
			scene.addChild(tf01);

		}

		private function makeObject3D_02(){
			tf02 = new DynamicText3D();
			tf02.typography = five3D.typography.HiraginoMinchoW6;
			tf02.size = 50;
			tf02.color = 0xCCCCCC;
			tf02.text = "ヒラギノ明朝W6を3Dに。";
			tf02.x = -290;
			tf02.y = -100;
			tf02.rotationZ = 20;
			tf02.rotationY = 40
			scene.addChild(tf02);
		}

		private function makeObject3D_03(){
			tf03 = new DynamicText3D();
			tf03.typography = five3D.typography.Georgia;
			tf03.size = 50;
			tf03.color = 0xAAAAAA;
			tf03.text = "Geiorgia! You can any fonts!";
			tf03.x = -230;
			tf03.y = -200;
			tf03.rotationZ = 30;
			tf03.rotationX = 70
			scene.addChild(tf03);
		}

		private function enterFrameHandler(e:Event):void{
			tf01.rotationZ += 0.001;
			tf01.z --
			tf02.z ++
			tf03.z ++
			tf03.rotationX +=0.1
		}
}}

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.