Run the cocos2dx project with the shortcut key under sublime

Source: Internet
Author: User
Sublime can be configured through. the sublime-build file is used to build compilation options or execute external script projects. Therefore, you need to switch between decode and sublime frequently. Then, you can use python to start the project, the procedure is as follows. sublime-build code, which is named. sublime-build

Sublime can be configured through. the sublime-build file is used to build compilation options or execute external script projects. Therefore, you need to switch between decode and sublime frequently. Then, you can use python to start the project, the procedure is as follows. sublime-build code, which is named. sublime-build

Sublime can build compilation options or execute external scripts by configuring the. sublime-build File.

Projects are developed using lua, So you often need to switch between decode and sublime. Then, you can use python to start the project. The specific steps are as follows:

The following is the. sublime-build code. Name it the name with the. sublime-build suffix and place it in the sublime user folder. xx. py is the absolute path of the python script.

{
"Cmd": ["python", "-u", "xx. py"],
"File_regex": "^ [] * File \"(...*?) \ ", Line ([0-9] *)",
"Selector": "source. lua"
}

The xx.exe is the relative directory of the execution file exe to the current Script directory. Similarly, xx/Resources is a relative directory.

Import ctypes

Import OS, sys

Handler = None
Operator = "open"
Fpath = OS. getcwd () + "xx.exe"
Param = None
Dirpath = OS. getcwd () + "xx/Resources"
Ncmd = 1
Shell32 = ctypes. windll. LoadLibrary ("shell32.dll ")

Shell32.ShellExecuteA (handler, operator, fpath, param, dirpath, ncmd)

After completing the work, you can open the lua file under sublime and press the shortcut key f7 to run the project.


Sublime also supports API prompts and completion, see the http://blog.csdn.net/wtyqm/article/details/9346863 for details

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.