flex4 倾斜字体

倾斜字体要在flex3中做的话用
选择特效:
mx.effects.Rotate来处理
<mx:Script>
<![CDATA[
[Bindable]
public var angle:int=0;
]]>
</mx:Script>
<mx:Rotate id="rotate" angleFrom="{angle-45}" angleTo="{angle}" target="{myVB}"/>
<mx:Label showEffect="{rotate}" />
而在flex4中对label做了扩展,先上图:
[img]http://dl.iteye.com/upload/attachment/569829/1bf9504b-d2f6-3d86-bd12-58ddf0389a9b.png[/img]

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:layout>
<s:VerticalLayout horizontalAlign="center" paddingTop="20" gap="20"/>
</s:layout>
<fx:Script>
<![CDATA[
]]>
</fx:Script>
<s:HSlider id="mySlider"
width="150"
minimum="-180" maximum="180" value="0"
liveDragging="true"/>
<s:Label
text="Rotated Text" fontSize="24"
rotation="{mySlider.value}"/>

</s:Application>


--TextFlow反转字体(0-360反转)

<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
width="500" height="300">
<fx:Script>
<![CDATA[
import flash.text.engine.TextRotation;
import flashx.textLayout.formats.BlockProgression;
import flashx.textLayout.formats.VerticalAlign;
import mx.collections.ArrayList;
import spark.events.IndexChangeEvent;
protected function rotateText(event:IndexChangeEvent):void {
var target:String = event.target.selectedItem;
switch(target) {
case "0":
// Here, the textRotation for each character in the TextFlow is changed:
tArea.textFlow.textRotation = TextRotation.ROTATE_0;
break;
case "90":
tArea.textFlow.textRotation = TextRotation.ROTATE_90;
break;
case "180":
tArea.textFlow.textRotation = TextRotation.ROTATE_180;
break;
case "270":
tArea.textFlow.textRotation = TextRotation.ROTATE_270;
break;
}
tArea.textFlow.invalidateAllFormats();
tArea.textFlow.flowComposer.updateAllControllers();
}
]]>
</fx:Script>
<s:ComboBox change="rotateText(event)" x="400"
dataProvider="{new ArrayList(['0', '90', '180', '270'])}"/>
<s:RichText id="tArea" width="300" fontSize="20" paddingTop="10">
<s:textFlow>
<s:TextFlow>
<s:p>
中国四川省广安县协兴乡牌坊村的一个客家家庭
</s:p>
<s:p>
Vertical alignment or justification (adopts default value if
undefined during cascade). Determines how TextFlow elements
align within the container.
</s:p>
</s:TextFlow>
</s:textFlow>
</s:RichText>
</s:Group>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值