You can create a custom Button skin that uses graphics that aren't necessarily square by using a Path and mouseEnabledWhereTransparent=false. For example here is a custom button skin that looks like a diamond:
CustomButtonSkin.mxml:
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
minWidth="21" minHeight="21" alpha.disabled="0.5"
mouseEnabledWhereTransparent="false">
<fx:Metadata>
<![CDATA[
[HostComponent("spark.components.Button")]
]]>
</fx:Metadata>
<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<s:Path data="M 50 0 L 0 50 L 50 100 L 100 50 L 50 0" top="0" left="0" right="0" bottom="0">
<s:fill>
<s:SolidColor color="red" alpha="1" alpha.over="0.8" alpha.down="0.5" />
</s:fill>
</s:Path>
<s:Label id="labelDisplay"
textAlign="center"
verticalAlign="middle"
horizontalCenter="0" verticalCenter="1" />
</s:SparkSkin>
Main.mxml:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<s:Button label="diamond button" skinClass="CustomButtonSkin" />
</s:Application>
相关推荐
我打出来的插件包,直接导入工程就可使用,内含Demo,UGUI中,不规则按钮,不管你的按钮多大,按钮图案空白部分被过滤掉。可按钮叠加使用,只响应不管第几层按钮图案部分,当响应后,下层按钮会被过滤,不会再次响应...
qml自定义多功能不规则形状按钮
NVIDIA Irregular Mask Dataset | 这里本着学习共享...,分享了Irregular Mask Dataset 中 用来做测试的 mask 160 张 png;也欢迎私信留言--共同学习,为了科研...
IRREGULAR VERBS 不规则动词表
Efficient Scheduling of Irregular Network Structures on CNN Accelerators 组会汇报PPT
基本不规则窗体的实现,有三种实现方法:椭圆窗体\作图路经法创建\位图窗体.
This thesis addresses the Irregular Piece Placement problem, also known as Nesting problem, while focusing on the resolution of real world instances with continuous rotations. The real world instances...
Irregular verbs.pdf
Irregular verbs.xlsx
对不规则二维图形的排样算法。基于遗传算法,用于加工件放料等
Complete and robust no-fit polygon generation for the irregular stock cutting problem E.K. Burke, R.S.R. Hellier, G. Kendall, G. Whitwell * University of Nottingham, School of Computer Science & IT, ...
UTC5000 Irregular-job_Manual
Get Smart 6 Irregular Verbs.doc
Get Smart 5 Irregular Verbs.doc
An inverse geometry problem in identifying irregular
Irregular-verbs-app
Improved Low-Density Parity-Check Codes Using Irregular Graphs