I have studied Lua over the past few days. I mainly focus on the integration between Lua and VC and write the code in the VC Host Program, then, call the code of the Host Program in Lua (or interface or component, whatever you call it), hoping to
Introduction to Cocos2d-x scripting language Lua
This blog record Lua learning, learning from the eoe Forum, Lua language development Cocos2d-x game getting started video tutorial, the following
1.
Io. Open (filename [, mode])
Function: open a file in the specified mode. If the file is successfully opened, the file handle is returned. If the file fails, the NIL + error message is returned.
Mode:
"R": Read mode (default );
"W":
Assume that you define a function in the script:
Function main (number)Number = number + 1Return numberEnd
In your game code, you want to call this function at a certain point in time to obtain its return value.
In Lua, the function is equivalent to
I. File Read and storage:-- Does not seem to support large files (cannot exceed 9 K ?)Function filesaveload ()Local file = Io. Open ("C: \ In. Lua", "R ");Assert (File );Local Data = file: Read ("* A"); -- read all contentFile: Close ();File = Io.
The file read-write model in Lua comes from the C language and is divided into complete models (like C) and simple models.
1. Simple model
Io.input ([file]) sets the default input file, file name (read in text) or file handle (can be understood as
Today's second task is similar to the first one. The difference is: to include a close in the pop-up UI, this close is remove rather than invisible, click the play button to play an animation. In the following buttons, The newui2 is not defined by
I have already talked about the usage of single-point touch, so it is very simple and easy for multi-point touch.
Multi-touch has two unique events: added and removed.
A contact is added to the added screen.
Removed removes one contact from the
Recently I used Vim to write Lua code. I found that many Lua symbols cannot jump because of the unfriendly Lua support of ctags.1) by default, the support for Lua by ctags is limited to the recognition function and does not support the definition of
Chapter 2 plug-in Analysis
Plug-ins are actually a collection of files. These files are stored on the client and loaded and run on the client. The available World of Warcraft custom plug-ins are already very rich. This chapter focuses on how the
Recently I used Vim to write Lua code. I found that many Lua symbols cannot jump because of the unfriendly Lua support of ctags.1) by default, the support for Lua by ctags is limited to the recognition function and does not support the definition of
I. syntax highlighting
Enable EditPlus,ToolsTools --"PreferencesPreference =Setting & syntaxSyntax
ClickAddButton to add a file type, in the followingDescr resume ptionEnterLua,FIle extensionEnterLua. Note that you can select one of the following
HowJavaUsed inLua scripting languageIs the content to be introduced in this article, mainly to learnLUA scripting languageInJAVAHow to use it,LuaNow it's popular, and the syntax is quite simple.JavaFor a long time, I recorded some things below for
Lua interacts with C ++ in this way.Messy foreplays:1. To download the Lua file from the official website, refer to-> Lua download and configuration.2. To set the environment, see-> VS to configure the Lua environment.The interaction process
First Cocos2d-x Lua gameWe wrote the first Cocos2d-x Lua program named HelloLua, learning other content from that project.Create a projectWe create a Cocos2d-x Lua project that can be implemented through the cocos command tool provided by the
Solve the problem of the previous article, on the code.The entrance to the C language program is the main function, and the Lua compiler's entry is the main function in the luac.c file.Let's take a look at the main function:int main (int argc, const
Briefly describe the environment:
This is a C ++ build system. It is extended based on premake and can manage the dependency relationship between packages [1]/libraries, each package publishes a Lua file along with binary to describe the
Iv. Lua calls C + +We implement it in three ways.Method One: Write the module directly into the LUA source codeIn Lua, we can write a function in LUA.C and then recompile the LUA file.After compiling it, it's like this: ()Then we can add our own
{--1, Environment-}For quick Start, a small, fast vc++6.0 compiler is usedand download the LUA installation package on the official website. Official Address {--http://10.21.210.18/seeyon/index.jsp--}When both are installed, they can be{--2,
Nginx as an API agent
There are a number of reasons why you use Nginx as an API agent. First of all, because he is open source, and secondly, Nginx has a lot of installation base, he has a strong community support behind, and performance is very
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.