Reader small image

You're reading from  Lua Quick Start Guide

Product typeBook
Published inJul 2018
Reading LevelBeginner
PublisherPackt
ISBN-139781789343229
Edition1st Edition
Languages
Right arrow
Author (1)
Gabor Szauer
Gabor Szauer
author image
Gabor Szauer

Gabor Szauer has been making games since 2010. He graduated from Full Sail University in 2010 with a bachelor's degree in game development. Gabor maintains an active Twitter presence, and maintains a programming-oriented game development blog. Gabor's previously published books are Game Physics Programming Cookbook and Lua Quick Start Guide, both published by Packt.
Read more about Gabor Szauer

Right arrow

Lua C API reference

By now, you have probably noticed that working with the Lua stack can get a bit confusing. Some functions push and pop values onto the stack and others don't. You can find out how each function manipulates the stack by reading through the Lua reference manual, available at: https://www.lua.org/manual/5.2/.

If you scroll down the manual page a bit, every Lua function is listed. Clicking on any of the C API functions will show the signature of the function, a description of how the function works, and some stack information. The manual page for the lua_setfield function as follows:

The stack information is called out in the upper right of the function. There are always three entries in this information box. The first one is how many elements the function removes from the stack, the second number is how many elements the function adds to the stack, and the...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Lua Quick Start Guide
Published in: Jul 2018Publisher: PacktISBN-13: 9781789343229

Author (1)

author image
Gabor Szauer

Gabor Szauer has been making games since 2010. He graduated from Full Sail University in 2010 with a bachelor's degree in game development. Gabor maintains an active Twitter presence, and maintains a programming-oriented game development blog. Gabor's previously published books are Game Physics Programming Cookbook and Lua Quick Start Guide, both published by Packt.
Read more about Gabor Szauer