"COCOS2D-JS official documents" Xi. Cc.path

Source: Internet
Author: User

Overview

The Singleton is designed to facilitate the developer to manipulate the file path. cc.pathThe purpose of the definition is to nodejs path keep it consistent. The API defined in it is basically nodejs the path same as the module, but not all, and may continue to be added as needed in the future. Also added are some path modules that do not have Pai, for example cc.path.changeExtname and cc.path.changeBasename .

Cc.path.join

Path stitching operation.

Parameters:

Name
Type

Variable-length parameters
String

Cc.path.extname

Gets the suffix name of the file path.

Parameters:

Name
Type

Pathstr
String

Cc.path.basename

Gets the file name.

Parameters:

Name
Type
Remark

Pathstr
String
Must fill in

Extname
String
Optional, specifies the name of the suffix to be removed from the file name, and does not consider removing the suffix name

Cc.path.driname

Gets the folder path where the file resides.

Parameters:

Name
Type
Remark

Pathstr
String
Required, File path

Cc.path.changeExtname

Change the file suffix name.

Parameters:

Name
Type
Remark

Pathstr
String
Must fill in

Extname
String
Specifies the suffix name to be modified, not the suffix name

Cc.path.changeBasename

Change the file name.

Parameters:

Name
Type
Remark

Pathstr
String
Must fill in

BaseName
String
Specifies the suffix name to be modified, not the suffix name

Issameext
Boolean
Whether the same suffix name is guaranteed

Example

See tests the PathTest test examples in.

"COCOS2D-JS official documents" Xi. Cc.path

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.