"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. Defined ascc.pathThe purpose is to follownodejsOfpathRemain consistent. The API defined inside is also basicallynodejsOfpathModules are consistent, but not all, and may continue to be added as needed in the future. It also adds a fewpathThe module does not have Pai, for examplecc.path.changeExtnameAndcc.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.

Reprint Please specify: http://www.cocos2dx.net/post/200

"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.