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 ...
随机推荐
- sql server 里类似replace的字符串子串删除
做如下替换: 将字符串asd#sdf#sdfsf中含# …# 形式的子串删除,写出sql语句 sql语句如下: UPDATE MM SET name =substring(name,0,CHAR ...
- js数字时钟
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- MySql 中游标,事务,终止存储过程方法总结
最近在项目开发中,有段逻辑处理,需要在网站,app,后台分别运行,这样给后期的维护带来了很大的不方便,容易遗漏app端或者后台,所以讲java代码转换成存储过程,把逻辑处理写在了mysql端,其中遇到 ...
- 布隆过滤器的概述及Python实现
布隆过滤器 布隆过滤器是一种概率空间高效的数据结构.它与hashmap非常相似,用于检索一个元素是否在一个集合中.它在检索元素是否存在时,能很好地取舍空间使用率与误报比例.正是由于这个特性,它被称作概 ...
- Java中对session的简单操作
1.jsp中操作session <% String name=(String)request.getSession().getAttribute("username"); / ...
- kernel/ptrace.c
/* ptrace.c *//* By Ross Biro 1/23/92 *//* edited by Linus Torvalds */ #include <linux/head.h> ...
- Android NDK几点回调方式
一.NDK中获取android设备ID的方式 Java代码如下(获取设备ANDROID_ID): final String androidId = Secure.getString(context.g ...
- js 测试
今天js测试题目: 被基础题目虐暴......惨不忍睹 1. var num = 2; switch(num){ case 1: console.log("1"); case 2: ...
- setTimeout的使用与参数传递
在使用JavaScript的时候,我们有时需要间隔的执行一个方法,比如用来产生网页UI动画特效啥的.这是我们常常会使用方法setInterval或setTimeout,但是由于这两个方法是由脚 ...
- python小知识点
问题:求列表中每个元素的元素次方之和>>> a=[1,2,3,4]>>> k=len(a)第一种解法# s=0# for x in a:# ...