lua之alter提示框
2016-05-10 12:44
651 查看
function UI.autoDisappearNote( str, disappearTime ) disappearTime = disappearTime or 1.0 --如果有弹出框,那么先移除掉弹出框 if cc.Director:getInstance():getRunningScene():getChildByTag( 777 ) then cc.Director:getInstance():getRunningScene():removeChildByTag( 777 ) end if cc.Director:getInstance():getRunningScene():getChildByTag( 888 ) then cc.Director:getInstance():getRunningScene():removeChildByTag( 888 ) end local noteBg = UI.sprite( "res/image/ui/bottom_tips.png" ) noteBg:setPosition( VisibleRect:center() ) cc.Director:getInstance():getRunningScene():addChild( noteBg, 77777, 777 ) --child zOrder tag local note = UI.label( "res/font/arts.ttf", 30, str ) note:setPosition( VisibleRect:center() ) cc.Director:getInstance():getRunningScene():addChild( note, 88888, 888 ) noteBg:runAction( cc.Sequence:create(cc.DelayTime:create(disappearTime), cc.FadeOut:create( 2.0 ), cc.CallFunc:create( function() noteBg:removeFromParent() end) ) ) note:runAction( cc.Sequence:create(cc.DelayTime:create(disappearTime), cc.FadeOut:create( 2.0 ), cc.CallFunc:create( function() note:removeFromParent() end) ) ) end
相关文章推荐
- 实现c++,java,lua 在c++编写后需要在 pkg 文件中添加新的函数 然后批处理下生成GamePlatformToLua
- 在实现安卓和ios的sdk中 c++,java,lua 混编学习记录
- LuaDoc 3.0.1 Lua源代码文档生成工具(转)
- lua 随机数
- 基于ngx_lua_waf模块配置web应用防火墙
- 快速掌握Lua 5.3 —— 调试库 (2)
- 快速掌握Lua 5.3 —— 调试库 (1)
- 快速掌握Lua 5.3 —— userdata (2)
- 快速掌握Lua 5.3 —— userdata (1)
- lua类的继承
- lua基本实验
- lua 中的上n级模块路径函数分享
- Lua脚本语言简明入门教程
- Introduction to Classification Evaluation Methods -- Part 1
- 使用IDA静态分析解密《舰娘Collection》的lua脚本
- Learn Lua in 15 Minutes
- LuaHotUpdate原理
- LuaHotUpdate原理
- Lua系统函数
- More Effective C++----(17)考虑使用lazy evaluation(懒惰计算法)