openscales实现漂亮的冒泡效果
使用的时候openscales 默认的冒泡效果确实有点简陋,想实现那种看着比较舒服的效果,只能自己定义了。参考现有的openscales实现的方式,它是通过控件的状态实现的,每个状态中使用Path绘制了一个形状,参考了一下网上的资料可以通过Fireworks绘制一个形状然后转换成路径,再导出成Fxg文件,打开文件就可以看到data的数据了。绘制的时候边缘一定不要留有空白,要不然在flex中就不容易控制位置了
由于将箭头放在了正中间,所以只做了上、下两个方向的
向上的CloudPopupTop.mxml
<s:Group x="{-hostComponent.width*0.5}" y="{-hostComponent.height}"
width="{hostComponent.width}" height="{hostComponent.height}">
<s:Path width="100%" height="100%" x="0" y="0" data="M 333 1 C 336 1 338 2 339 3 C 340 7 341 12 341 15 C 341 15 341 185 341 185 C 340 188 338 191 335 191 C 335 191 181 191 181 191 C 177 196 174 201 171 206 C 168 202 164 196 159 191 C 159 191 5 191 5 191 C 4 190 2 189 1 187 C 1 187 1 5 1 5 C 2 3 5 1 7 1 C 7 1 333 1 333 1 Z ">
<s:fill>
<s:SolidColor color="#FFFFFF" alpha="1"/>
</s:fill>
<s:stroke>
<s:SolidColorStroke color="#CCCCCC"/>
</s:stroke>
</s:Path>
<s:Group id="contentGroup" contentBackgroundAlpha="0" width="100%" height="100%" minWidth="0" minHeight="0"
x="0" y="5">
</s:Group>
</s:Group>
向下的CloudPopupBottom.mxml
<s:Group x="{hostComponent.width*0.5}" y="{hostComponent.height }"
width="{hostComponent.width}" height="{hostComponent.height}">
<s:Path rotationX="-180" rotationY="180" width="100%" height="100%" x="0" y="0" data="M 333 1 C 336 1 338 2 339 3 C 340 7 341 12 341 15 C 341 15 341 185 341 185 C 340 188 338 191 335 191 C 335 191 181 191 181 191 C 177 196 174 201 171 206 C 168 202 164 196 159 191 C 159 191 5 191 5 191 C 4 190 2 189 1 187 C 1 187 1 5 1 5 C 2 3 5 1 7 1 C 7 1 333 1 333 1 Z ">
<s:fill>
<s:SolidColor color="#FFFFFF" alpha="1"/>
</s:fill>
<s:stroke>
<s:SolidColorStroke color="#CCCCCC"/>
</s:stroke>
</s:Path>
<s:Group id="contentGroup" contentBackgroundAlpha="0" width="100%" height="100%" minWidth="0" minHeight="0"
x="{-hostComponent.width}" y="{-hostComponent.height+23}">
</s:Group>
</s:Group>
FxPopup文件修改如下
将relativePosition的相对位置改成这样:
public function set relativePosition(value:String):void {
this._relativePosition = value;
var sta:String=(_relativePosition==BL || _relativePosition==BR)?"b":"t";
setCurrentState(sta,false);
}
<s:states>
<s:State name="t"/>
<s:State name="b"/>
</s:states>
<s:Panel id="panel"
width="{WIDTH}"
height="{HEIGHT}"
backgroundAlpha="0"
skinClass.t="org.openscales.fx.popup.skin.CloudPopupTop"
skinClass.b="org.openscales.fx.popup.skin.CloudPopupBottom">
<s:Group id="popupContentGroup"
contentBackgroundAlpha="0"
width="{WIDTH}"
height="{HEIGHT}"
clipAndEnableScrolling="true"
creationComplete="{_popupRenderer.draw()}"/>
</s:Panel>

参考资料:
http://stackoverflow.com/questions/16019100/how-do-i-create-spath-data-polygon-coords
openscales实现漂亮的冒泡效果的更多相关文章
- C#自动生成漂亮的水晶效果头像
C#自动生成漂亮的水晶效果头像 与其他的微博系统相同,在“多可内网微博系统”的用户也可上传自己的头像,并支持头像裁剪. 但“多可内网微博系统”的头像可以更漂亮,因为系统实现了水晶效果的头像.C#程序实 ...
- SweetAlert – 替代 Alert 的漂亮的提示效果
Sweet Alert 是一个替代传统的 JavaScript Alert 的漂亮提示效果.SweetAlert 自动居中对齐在页面中央,不管您使用的是台式电脑,手机或平板电脑看起来效果都很棒.另外提 ...
- 原生js实现canvas气泡冒泡效果
说明: 本文章主要分为ES5和ES6两个版本 ES5版本是早期版本,后面用ES6重写优化的,建议使用ES6版本. 1, 原生js实现canvas气泡冒泡效果的插件,api丰富,使用简单2, 只需引入J ...
- 20个漂亮 CSS3 按钮效果及优秀的制作教程
在这篇文章中,我们编译了一组有用的 CSS3 动画按钮教程和引人注目的实验.正如我们都知道的,CSS3在网页设计方面是最重要和最关键的,可以使您的网站对访客更具吸引力和互动性.你可以学习这些教程和试验 ...
- android仿今日头条App、多种漂亮加载效果、选择器汇总、记事本App、Kotlin开发等源码
Android精选源码 android漂亮的加载效果 android各种 选择器 汇总源码 Android仿bilibili搜索框效果 Android记事本app.分类,涂鸦.添加图片或者其他附件 仿 ...
- swift 实现漂亮的粒子效果CAEmitterLayer
一些粒子效果 我们经常会在一些游戏或者应用中看到一些炫酷的粒子效果,我们在iOS中也能很轻松的搞一些粒子效果 我们本次做得是一个下雪的效果,看下效果图 源码地址: https://github.com ...
- 漂亮的ActionBar效果
Newsstand—这个应用引进了新的方式,使得ActionBar达到了新的水平.如果你打开这个应用的发布页,你会注意到不带图标的ActionBar是半透明的,而且和一个大的图片集(一个大的杂志图标, ...
- C# WPF 漂亮的loading 效果
<UserControl x:Class="TestLoadPic.Loading" xmlns="http://schemas.microsoft.com/win ...
- openlayers中实现自定冒泡的效果
自定义的Openlayers.Popup.FreshCloud继承自Openlayers.Popup.Framed,实现了比较简洁的冒泡效果,详细代码如下 /** * Class: OpenLayer ...
随机推荐
- 新建STM32工程
1) 2)保存 3)选择公司和芯片的型号,STM32F103C8T6,64kB Flash, 20kB SRAM. 4)手动添加启动代码 5)新建如下文件夹 6)回到工程,选中target,右键Add ...
- create dll project based on the existing project
Today, I have to create a dll project(called my.sln), the dllmain.cpp/.h/ is already in another proj ...
- JS-学习-DOM元素尺寸和位置
一,获取元素的css大小 1.通过style内联获取元素的大小 var box = document.getElementById('box'); // 获得元素; box.style. ...
- LeetCode 【318. Maximum Product of Word Lengths】
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the tw ...
- 使用OpenLDAP构建基础账号系统
LDAP - Lightweight Directory Access Protocol,对该协议的具体应用,常见的是微软的Active Directory服务和Linux上的OpenLDAP组件. ...
- Java Concurrent之 AbstractQueuedSynchronizer
ReentrantLock/CountDownLatch/Semaphore/FutureTask/ThreadPoolExecutor的源码中都会包含一个静态的内部类Sync,它继承了Abstrac ...
- 不同编程语言打印“元旦快乐!"
javascript: document.write("元旦快乐!"+"<br/>"); PHP: <?php echo "元旦快乐 ...
- 基于XML的AOP配置-转
http://www.cnblogs.com/yangy608/archive/2010/11/14/1876839.html AOP(Aspect-Oriented Programming,面向切面 ...
- javascript 键盘输入过滤,只能输入数字,小数一位且只能输入5
$("#right_div2 input[type='text'][class='textClass'][id^='asd_']").live("keydown" ...
- Python>>>Flask框架使用之入门
操作平台Windows Python2.7 安装 pip install flask Hello World程序 from flask import Flask app = Flask(__name_ ...