Sublime Text Development quick-cocos2d-x Environment Building (MAC)

Source: Internet
Author: User
Tags lua sublime text git commands

This article was reproduced in: http://blog.csdn.net/wxhqforever/article/details/44812003

Preparatory work:

1, first download quick-cocos2dx-2.2.5-plus-release version of: Https://github.com/chukong/quick-cocos2d-x/tree/2.2.5-plus-release

2, download sublime text 2, here do not use 3 version of (some plug-in does not support 3 version), as: http://www.sublimetext.com/, installation method is not much said, registration code as follows (all paste into, including begin and end):

-----BEGIN LICENSE-----

Andrew Weber

Single User License

ea7e-855605

813A03DD 5e4ad9e6 6c0eeb94 bc99798f

942194A6 02396E98 e62c9979 4bb979fe

91424c9d A45400BF f6747d88 2fb88078

90f5cc94 1CDC92DC 8457107A f151657b

1d22e383 a997f016 42397640 33F41CFC

E1d0ae85 a0bbd039 0e9c8d55 e1b89d5d

5cdb7036 e56de1c0 EFCC0840 650cd3a6

b98fc99c 8fac73ee d2b95564 DF450523

------END LICENSE ———

Next steps:

1. Unzip the downloaded quick Compress package, then enter the folder at the terminal, and then type the following command: "./setup_mac.sh", he will ask you "does you wish to install Luajit (y/n)?" , direct enter (yes), and then until he finishes, open the folder Player->mac->player, as shown in:

Here you can create a new project, open a project, or view an example, without saying much

2. We create a quick project, as shown in:

3. Open Sublime Text (hereafter referred to as St), press "CTRL + '" Key to open ST's console, enter the following command to install the package controll (there is another way is to directly download the plugin to install, please self-Baidu), such as the output is correct, and then restart the ST:

Command:

Import Urllib2,os; Pf= ' Package control.sublime-package '; Ipp=sublime.installed_packages_path (); Os.makedirs (IPP) if not os.path.exists (IPP) else None; Urllib2.install_opener (Urllib2.build_opener (urllib2. Proxyhandler ())); Open (Os.path.join (IPP,PF), ' WB '). Write (Urllib2.urlopen (' http://sublime.wbond.net/' +pf.replace (', '%20 '). Read () ); print ' Restart Sublime Text to finish installation '

The following menu appears:

4, open the package controll, enter or select the Install package (here command can not all input, press ENTER to automatically match the following first command)

Install the interface as follows, enter the plugin we want and then press ENTER or the mouse selection will be installed automatically:

I installed a git plug-in, the lower left corner is the status of St, the successful installation will prompt installation in the lower left corner:

5, we develop the need for quick is a plug-in called Quickxdev (Code intelligence Tips), download after the installation is completed through the Preference->package settings to view:

Next we open the default Settings, copy the contents and close, then open User Settings, paste into the content just copied, "Quick path" modified to QUICK-COCOS2DX path, will "author" Change to the name you want (the name that appears when you create a new file)

6, the configuration needs to replace the original Quickxdev content, because the plug-in settings are automatically upgraded to the latest version, we can not use the latest, the latest no COCOS2DX native API code hints, You need to download a QuickXDev-2.2.5 plugin to replace it yourself: https://github.com/leitwolf/QuickXDev/archive/v2.2.5.zip

First, we need to open the Preference->browser package, find the Quickxdev folder, remove all the contents of the content, and then the contents of the packages just downloaded, and finally restart St can be completed

Previous diagram (you need to change the language plain text in the lower-left corner to LUA):

The Code hints for St are not the same as other Ides:

(1) If you call Lua encapsulated function, we can enter the function of the desired call directly, such as, without the need to enter "." or ":" and the like (input is useless, but will not prompt)

(2) If the call COCOS2DX native function, you can directly press input, here can also be entered separately, we first enter the first half of the Ccsprite, and then enter ":" (remind us to invoke the method with a single ":" Instead of "::"), also no hint, But when we continue to enter the function name, the prompt will appear, which requires us to know some of the class's function definitions (the above display can also do so, but the result is that the prompt is incomplete, you can try)

7, the new quick project dragged into the St, we move the mouse to the Scripts folder and then right-click "Run with Player" to run the project, fast, particularly convenient

8, below we need to download and install some auxiliary plug-in, the choice (http://blog.jobbole.com/79326/)

(1) ColorPicker: If you often want to view or set the color value, this plugin can easily call your native palette app, you can either select a color in the palette, and then press the "OK" button to fill the value into the Sublimetext active document in the current position, You can also select a color value in the active document, and pressing the plug-in's shortcut key (COMMAND+SHIFT+C) will position the color of the value in the displayed palette.

(2) Formatlua: Use Option+l shortcut key to automatically format LUA code, Formatlua plug-in is not perfect, there are many formats will let the end of the file blank line growing small bug, but his flaws, team collaboration development or ruthless need to install one, After all, no one likes to read the bad code written by others.

(3) Docblockr:docblockr can make it easy for you to set up documentation for your code. It parses functions, variables, and parameters, and automatically generates a document paradigm based on them, and your job is to fill in the corresponding instructions. However, there is no support for LUA and I hope that it will be supported later.

(4) Sublimelinter: This plugin is mainly for the role of grammar check hints, the following will be highlighted.

(5) Git: This plugin will integrate git into your sublimetext so that you can run GIT commands in Sublimetext, including adding, submitting files, viewing logs, file annotations, and other git features.

(6) ctags:http://blog.csdn.net/chiuan/article/details/8569717

9, Sublimelinter Detailed:

This plugin, which is installed with ST2, will prompt for the framework that is activated for ST3, but can be used here, and in order to support LUA, we need to configure

(1) First download Lua-5.1 Source: http://www.lua.org/ftp/lua-5.1.5.tar.gz, after the download is complete from the terminal into the Lua source folder, and then execute the following command: "Make MacOSX test", The following results appear to be correct:

Install the LUA environment after completing the "sudo make install" after entering the password, as shown in the installation is successful, you can install the Sublimelinter plugin at this time:

The following tips appear in the console (Ctrl + ') of St to indicate that the Sublimelinter plugin is successfully installed and can be used in Lua:

Also learn to do some configuration to return to the above prompt results, open preference->package settings->sublimelinter->user Setting, enter the following configuration to succeed:

{

"Sublimelinter": true,

"Sublimelinter_popup_errors_on_save": True

}

Description

"Sublimelinter" is the configuration when checking code syntax, there are 4 modes:

(1) True-real-time check in the background when user input, (2) False-check only when initialization, (3) "Load-save"-check when file is loaded and saved, (4) "Save-only"-check when file is saved.

"Sublimelinter_popup_errors_on_save" is set to True to prompt for syntax warnings or errors when saving files, as well as other configurations to find the configuration on its own.

Sublime Text Development quick-cocos2d-x Environment Building (MAC)

Related Article

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.