Lua quick start guide the easiest way to learn Lua programming
The easiest way to learn Lua programming Key Features The easiest way to learn Lua coding Use the Lua standard libraries and debug Lua code Embed Lua as a scripting language using the Lua C API Book Description Lua is a small, powerful and extendable scripting/programming language that can be used f...
Other Authors: | |
---|---|
Format: | eBook |
Language: | Inglés |
Published: |
Birmingham ; Mumbai :
Packt Publishing
[2018]
|
Edition: | 1st edition |
Subjects: | |
See on Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009630757306719 |
Table of Contents:
- Cover
- Title Page
- Copyright and Credits
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: Introduction to Lua
- Technical requirements
- What Lua is
- Source code and binaries
- Installing Lua on Windows 10
- Installing Lua on macOS
- Installing Lua on Linux
- Tools for Lua
- Installing VS Code on Windows 10
- Installing VS Code on macOS
- Installing VS Code on Linux
- Exploring VS Code
- Hello World!
- Summary
- Chapter 2: Working with Lua
- Technical requirements
- Variables
- Creating variables
- Printing variables
- Assigning variables
- Comments
- Basic types
- nil
- Boolean
- number
- Finding a type
- String types
- String literals
- String length
- Concatenate strings
- String coercion
- Escape characters
- Console input
- Scope
- Scope access
- Global scope
- Shadowing
- Functions
- Defining a function
- Calling a function
- Function arguments
- Any number of arguments
- Returning a value
- Returning multiple values
- Operators
- Arithmetic operators
- Relational operators
- Logical operators
- Misc operators
- Operator precedence
- Control structures
- if
- elseif
- else
- Nesting if statements
- Loops
- while loops
- Infinite loops
- Breaking a loop
- Repeat until loop
- for loop
- Nested loops
- Summary
- Chapter 3: Tables and Objects
- Technical requirements
- Introduction to tables
- Creating tables
- Storing values
- Table constructor
- Tables are references
- Arrays
- Array constructor
- Arrays are one-based
- Sparse arrays
- The size of an array
- Multidimensional arrays
- Iterating
- Understanding pairs
- Understanding ipairs
- Closures
- Iterator functions
- Meta tables
- setmetatable
- getmetatable
- __index
- __newindex
- rawget and rawset
- __call
- Operators
- Math operators
- Equivalence operators.
- Other operators
- Objects
- Classes
- The : operator
- Tables inside of objects
- Inheritance
- Single inheritance
- Multiple inheritance
- Summary
- Chapter 4: Lua Libraries
- Technical requirements
- The global table
- Explicit variables
- Dynamic variables
- Environment
- math
- Trigonometry
- Changing numbers
- Comparing numbers
- Randomness
- Constants
- Everything else
- File IO
- Opening a file
- Writing data
- Reading data
- Reading line by line
- Reading bits of data
- Closing a file
- Interfacing with the operating system
- Working with time
- Interacting with the shell
- Working with files
- More strings
- Searching for a substring
- Extracting a substring
- Case manipulation
- Creating and loading modules
- Creating a module
- Loading and using modules
- Avoiding parsing
- Executing files
- Summary
- Chapter 5: Debugging Lua
- Technical requirements
- The debug library
- Introspective information
- The debug.getinfo return value
- Filtering the information
- Local variables
- Hooks
- Line ("l")
- Call ("c")
- Return ("r")
- Setting a counter
- Multiple hooks
- Traceback
- Debugger.lua
- Using debugger.lua
- Error-handling in Lua
- pcall and error
- assert
- Profiling
- The profile module
- Using the profile module
- Integrated development environments
- LuaEdit
- Breakpoints
- Locals and Watch
- Callstack
- Decoda
- Starting debugging
- Everything else
- Zero Brane Studio
- Selecting an interpreter
- Starting the debugger
- Visual Studio Code
- Summary
- Chapter 6: Embedding Lua
- Technical requirements
- Working with the C API
- The stack
- Pushing to the stack
- Querying the stack
- Reading from the stack
- Stack size
- Reading Lua variables from C
- Loading a Lua file
- Reading global variables
- Example
- Creating Lua variables from C.
- Calling Lua functions from C
- Calling C functions from Lua
- Working with tables in C
- Reading values from a table
- Writing values to a table
- Meta tables
- User data
- Lua C API reference
- Summary
- Chapter 7: Lua Bridge
- Technical requirements
- API conventions
- Namespaces
- Variables
- Functions
- Properties
- Classes
- Constructor
- Subclass
- Member variables, properties, and functions
- Static variables, properties, and functions
- Calling C functions from Lua
- LuaRef
- LuaRef and tables
- Summary
- Chapter 8: Next Steps
- Books
- Programming In Lua
- Learning Game AI Programming with Lua
- LÖVE for Lua Game Programming
- Lua Game Development Cookbook
- Game Development with Lua
- Beginning Lua Programming
- Lua Programming Gems
- Learn Lua for iOS Game Development
- Game engines
- LÖVE 2D
- Defold
- Corona
- Leadwerks
- Gideros
- Urho 3D
- Polycode
- ShiVa
- Game mods
- Roblox
- Garry's Mod
- World Of Warcraft
- Natural Selection 2
- Don't Starve
- Hack 'n' Slash
- Scriptable software
- CEGUI
- Conky
- Premake
- Moho
- Summary
- Other Books You May Enjoy
- Index.