mirror of https://github.com/axmolengine/axmol.git
Notification effect enhancement
This commit is contained in:
parent
9fe278b31f
commit
1bcc2dec37
|
@ -1252,8 +1252,18 @@ void Director::setContentScaleFactor(float scaleFactor)
|
||||||
|
|
||||||
void Director::setNotificationNode(Node *node)
|
void Director::setNotificationNode(Node *node)
|
||||||
{
|
{
|
||||||
CC_SAFE_RELEASE(_notificationNode);
|
if (_notificationNode != nullptr){
|
||||||
_notificationNode = node;
|
_notificationNode->onExitTransitionDidStart();
|
||||||
|
_notificationNode->onExit();
|
||||||
|
_notificationNode->cleanup();
|
||||||
|
}
|
||||||
|
CC_SAFE_RELEASE(_notificationNode);
|
||||||
|
|
||||||
|
_notificationNode = node;
|
||||||
|
if (node == nullptr)
|
||||||
|
return;
|
||||||
|
_notificationNode->onEnter();
|
||||||
|
_notificationNode->onEnterTransitionDidFinish();
|
||||||
CC_SAFE_RETAIN(_notificationNode);
|
CC_SAFE_RETAIN(_notificationNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,12 @@ var SceneTestLayer1 = cc.Layer.extend({
|
||||||
}, this);
|
}, this);
|
||||||
var item4 = new cc.MenuItemFont("setNotificationNode", function () {
|
var item4 = new cc.MenuItemFont("setNotificationNode", function () {
|
||||||
var layerTemp = new cc.LayerColor(cc.color(0, 255, 255, 120));
|
var layerTemp = new cc.LayerColor(cc.color(0, 255, 255, 120));
|
||||||
|
var sprite = new cc.Sprite(s_pathGrossini);
|
||||||
|
sprite.setPosition(cc.p(winSize.width/2,winSize.height/2));
|
||||||
|
layerTemp.addChild(sprite);
|
||||||
cc.director.setNotificationNode(layerTemp);
|
cc.director.setNotificationNode(layerTemp);
|
||||||
|
var rotation = cc.rotateBy(2,360);
|
||||||
|
sprite.runAction(rotation.repeatForever());
|
||||||
cc.log("setNotificationNode!");
|
cc.log("setNotificationNode!");
|
||||||
}, this);
|
}, this);
|
||||||
var item5 = new cc.MenuItemFont("clearNotificationNode", function () {
|
var item5 = new cc.MenuItemFont("clearNotificationNode", function () {
|
||||||
|
|
Loading…
Reference in New Issue