Refer to the self-built.
This article records how to build the best coding environment for Lua scripts in the MAC system environment with powerful Code Completion and compilation and running.
The sublime text editor is used here. The following describes in detail:
(1) download sublime text
Note that the version is 2.0.2 and sublime text 2.
(2) install the Lua e
[Lua] Getting Started tutorial, lua getting started tutorialWhat is Lua?
Lua is a small scripting language. It is a research group at the Pontifical Catholic University of Rio de Janeiro in Rio de Janeiro, developed in 1993 by Robert Ierusalimschy, Waldemar Celes, and Luiz H
Http://www.unknownworlds.com/decoda
Today, colleagues in the project team raised the need for the entire Lua debugging tool. Due to the increasing number of Lua scripts used in recent projects, the chance of script problems is also increasing ~~ . Debugging is not very convenient, so it is necessary to complete one. So we first found a runner to meet the needs of the project. Next, I will post the software
This is the second of my Lua series tutorials, which focuses on data transfer between C + + and Lua. If you don't yet know how to call Lua scripts in C + +, refer to this article. This article mainly introduces the delivery of basic data types, such as shaping (int), string (string), number, and bool value.
Load and run LUA
This article will explain how to manipulate LUA arrays and string types in C + +, as well as how to store the LUA State (registry and Upvalue) in C + + functions, and Registry is useful when using C + + custom types. You can easily specify metatable for UserData.
C + + operations Lua array
Lua Array Overview
In
Coding (Code city) basic configuration tutorial, coding tutorial
Coding was first recognized as a new company. The predecessors said that we use coding. As a git configuration, we should refer to the
It's been half a month since I wrote a LUA article, and it's time to refresh your LUA state. This tutorial will introduce the LUA stack and basic stack operations, as well as how to read the LUA table in C + + code.
Understanding the LU
This tutorial will explain how to call C + + functions in Lua.
In Lua, it is simpler to call C + + functions, and this article will demonstrate a concrete approach with two examples: one for averages and the other for printing parameter information for LUA functions.
Finally, this article describes how to define thes
you to invoke the table like a function callsetmetatable ({}, { function(t, a, B, C, whatever) return (A + B + c) * whatever
end}) Local result = T (1234)Print (Result)__tostringFinally, __tostring, it can define how to convert a table to a string, often with print , because by default, when you print a table, you will see table:0x7f86f3d04d80 Such a codeLo_table =setmetatable({1,2,3}, {__tostring=function(lo_table) sum=0 for_, Vinch Pairs(lo_table) Dosum= Sum +vEnd return
remote warehouse
Click on the link and drop it directly into the GitHub client window. Set the path to the local repository in the pop-up window. As a result, the remote repository is cloned to the local repository.4, the basic use of GHFW
GHFW Interface Description
After adding and editing files in the working directory, check the GHFW window for any changes that need to be submitted. This submission is then described and submitted.
= {} local function getname () return "Hao Chen" End Function haosmodel.greeting () print ("Hello, My Name is ". GetName ()) End return HaosmodelSo we can use this:Local Hao_model = require ("Mymod") Hao_model. Greeting ()In fact, require do the following: (so you know why our module files are written like that)Local Hao_model = (function () --mymod.lua file content--end) ()Vi. concluding remarksIs this the end of it? Of course not, next, we need to use the
Document directory
HTML tags and JavaScript tutorial
HTML tags and JavaScript tutorial
Lua language tutorial [go]
Reprinted ---- I have read the reprinted articles and have not explained the source, so I will not write the source for the time being. I hope to tell you the source of the original article. Thank yo
This article is the last tutorial on C + + and Lua interaction, after which we will combine cocos2d-x to introduce LUA bindings. This article mainly describes how to bind a simple C + + class into Lua and provide LUA object-oriented access.
Binding C + + classes
Defining C
before a block of code endsExamples of functions--Declaring the function type variable sumfunction sum (v1,v2)--function body return v1 + v2end--The same function variable can also be declared as follows Mul = function (v1,v2)--function body return v1 * v2end-- Call the first function sumprint (sum (2,3))--Call the second function mulprint (Mul (3,4))the classes in LuaAs I said before, table types can have any type of value, including functions!Therefore, we can create a table with function var
AboutLUA environment ConfigurationThe Learning tutorial is the content to be introduced in this article, mainly to learn howConfigure luaOfEnvironmentFor more information, see the detailed description.
Environment: Lua for windows (lfW)
Home: http://luaforwindows.luaforge.net/
Lua for windows is actually a complete Lua
registration.
For example, if update () is written in the script in step 1, it is equivalent to test. Update () in C ++ ();
8. Directly calling the registered Lua function in C ++
(*pState)->DoString("update()");
This statement only executes the "update ()" script.
In addition, the header files of LuaPlus and Lua, as well as. lib and. dll of LuaPlus, should be put under the project directory. These
Basic tutorial on using modules in Lua
This article mainly introduces the basic usage of modules in Lua. It is the basic knowledge of Lua beginners. For more information, see
What is a module?
A module is an image. You can use a library that needs to be loaded and contains a single global name in the table. This module
LuaProgramming Skills Learning tutorial is the content to be introduced in this article, mainly to learnLUAProgramming skills, so that you can learn more easily, first to the details of this article.LuaVersion 5.1 has been officially released. Now we should put all the discussions on this version.
Use local whenever possibleVariableNot globalVariable. This isLuaThe easiest mistake for beginners. The global variable is actually placed in a global table
. GetMethod ("LuaSleep "));
// Load the aifile
LuaVM. DoFile (System. AppDomain. CurrentDomain. BaseDirectory + _ petPath + "\ ai. lua ");
}
RegisterFunction registers a public function in the C # code (the latest version of LuaInterface supports private) for the Lua script. You do not need to care about the number and type of parameters.
Lua:
Pet
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.