导读热词
实现游戏中需要在屏幕底部弹出消息提示弹窗,经过特定时间后渐隐消失。当有新的消息提示时,原来没有消失的弹窗会上移,并继续渐隐直至消失。
转载声明:http://blog.csdn.net/operhero1990/article/details/47165365
1、使用cocostudio建立一个最简单的弹窗界面,命名为hintFrame
设置黑底的透明度为100/255,这样能起到一个蒙版的效果。两个Label分别显示消息题目和内容。
2、创建控制弹窗的lua类脚本,命名为UI_hintFrame
local SPACING = 5
--init
function UI_hintFrame:init()
-- data
-- ===============================
-- ui
-- ===============================
self.wigetRoot = ccs.GUIReader:getInstance():widgetFromJsonFile(config.dirUI.root .. "hintFrame.json")
self.x,self.y = self.wi