Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lua - How to make argument optional

12 views
Skip to first unread message

Yi Cheng Lee

unread,
Jul 7, 2013, 11:58:20 PM7/7/13
to
Hey I need to expand some of the Lua gr commands and I want to make some
arguments optional. For example

gr.light({200, 202, 430}, {0.8, 0.8, 0.8})

should set the attenuation to a default of {1, 0, 0}

How can I do this

stepha...@gmail.com

unread,
Jul 9, 2013, 1:09:29 AM7/9/13
to
You might be able to do that with:
http://pgl.yoyo.org/luai/i/lua_gettop

You can use it to get the number of arguments that you are being given.
0 new messages