<commit_before>#include "MainScene.h"
#include "MainMenuLayer.h"
#include "BackgroundLayer.h"
#include "GameLayer.h"
USING_NS_CC;
#include "ElemsPreloadManager.h"

MainScene::MainScene() 
	:_pSelfCamera(nullptr)
{
}

MainScene::~MainScene()	
{
	CC_SAFE_RELEASE_NULL(_pSelfCamera);
}


// on "init" you need to initialize your instance
bool MainScene::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Scene::init() )
    {
        return false;
    }

	ElemsPreloadManager::registerMoveAbleElemTypes();

	auto glView = Director::getInstance()->getOpenGLView();

	Size designSize = Size(960, 540);
	auto screanRatio = glView->getFrameSize().width / glView->getFrameSize().height;
	auto ratio_16_9 = 16.0f / 9.0f;
	if (screanRatio < ratio_16_9)
	{
		designSize = Size(960, 640);
	}

	glView->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL);

	auto cameraBackground2D = Camera::createOrthographic(designSize.width, designSize.height, 0, 100);
	cameraBackground2D->setCameraFlag(CameraFlag::USER2);
	this->addChild(cameraBackground2D);
	cameraBackground2D->setDepth(-5);

	//todo ˳зʽ
	auto cameraMainUI = Camera::createOrthographic(designSize.width, designSize.height, 0, 100);
	cameraMainUI->setCameraFlag(CameraFlag::USER4);
	this->addChild(cameraMainUI);
	cameraMainUI->setDepth(5);<commit_msg>use NO_BORDER:can suit to all ratios<commit_after>#include "MainScene.h"
#include "MainMenuLayer.h"
#include "BackgroundLayer.h"
#include "GameLayer.h"
USING_NS_CC;
#include "ElemsPreloadManager.h"

MainScene::MainScene() 
	:_pSelfCamera(nullptr)
{
}

MainScene::~MainScene()	
{
	CC_SAFE_RELEASE_NULL(_pSelfCamera);
}


// on "init" you need to initialize your instance
bool MainScene::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Scene::init() )
    {
        return false;
    }

	ElemsPreloadManager::registerMoveAbleElemTypes();

	auto glView = Director::getInstance()->getOpenGLView();

	Size designSize = Size(960, 540);
	auto screanRatio = glView->getFrameSize().width / glView->getFrameSize().height;
	auto ratio_16_9 = 16.0f / 9.0f;
	if (screanRatio < ratio_16_9)
	{
		designSize = Size(960, 640);
	}

	glView->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER);

	auto cameraBackground2D = Camera::createOrthographic(designSize.width, designSize.height, 0, 100);
	cameraBackground2D->setCameraFlag(CameraFlag::USER2);
	this->addChild(cameraBackground2D);
	cameraBackground2D->setDepth(-5);

	//todo ˳зʽ
	auto cameraMainUI = Camera::createOrthographic(designSize.width, designSize.height, 0, 100);
	cameraMainUI->setCameraFlag(CameraFlag::USER4);
	this->addChild(cameraMainUI);
	cameraMainUI->setDepth(5);
{'fraction_non_alphanumeric': 0.15577342047930284, 'fraction_numerical': 0.029048656499636893, 'mean_word_length': 4.963203463203463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3997690', 'n_tokens_mistral': 1010, 'n_tokens_neox': 936, 'n_words': 160}