From 7e1db178ab8440d1d88f7ec4c80e5c59af151b95 Mon Sep 17 00:00:00 2001 From: halx99 Date: Sat, 13 Aug 2022 09:35:38 +0800 Subject: [PATCH] Improve template HelloCpp code style [skip ci] --- .../cpp-template-default/Classes/HelloWorldScene.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.cpp b/templates/cpp-template-default/Classes/HelloWorldScene.cpp index fc512b8d46..5132d3853a 100644 --- a/templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -46,9 +46,9 @@ bool HelloWorld::init() return false; } - auto visibleSize = Director::getInstance()->getVisibleSize(); - auto origin = Director::getInstance()->getVisibleOrigin(); - auto safeArea = Director::getInstance()->getSafeAreaRect(); + auto visibleSize = _director->getVisibleSize(); + auto origin = _director->getVisibleOrigin(); + auto safeArea = _director->getSafeAreaRect(); auto safeOrigin = safeArea.origin; ///////////////////////////// @@ -122,10 +122,10 @@ bool HelloWorld::init() void HelloWorld::menuCloseCallback(Ref* sender) { // Close the cocos2d-x game scene and quit the application - Director::getInstance()->end(); + _director->end(); /*To navigate back to native iOS screen(if present) without quitting the application ,do not use - * Director::getInstance()->end() as given above,instead trigger a custom event created in RootViewController.mm + * _director->end() as given above,instead trigger a custom event created in RootViewController.mm * as below*/ // EventCustom customEndEvent("game_scene_close_event");