You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to design how signals will work in Lua and Godot. A signal will be an element in a table in the class object and will follow the definitions from the initial call for the implicit available signals method.
Following below is an excerpt for some of the the designs I have so far.
localclass=require'lua.class' -- Import the system class librarylocalSprite=require'godot.Sprite' -- Make sure to import the base classlocalMain=class.extends(Sprite) -- Create the user subclassMain:signals {
{ name='sum_calculated', parameters= { name='sum', type='number' } },
{ name='completed' } },
{ name='new_title', parameters= { name='title' } },
}
functionMain:ready()
math.randomseed(os.time()) -- Randomize from whatever the time isendfunctionMain:process(delta)
localsum=math.random(100)
emit_signal( 'sum_calculated', sum )
endreturnMain
The signals in the code above have the following characteristics:
sum_calculated has one parameter called sum with the data type defined as string
completed signal has no parameters
new_title has one parameter called title with the default data type string
Please share your thoughts on this idea or show us a new idea that you come up about this topic.
-- Perbone
The text was updated successfully, but these errors were encountered:
The idea is to design how signals will work in Lua and Godot. A signal will be an element in a table in the class object and will follow the definitions from the initial call for the implicit available signals method.
Following below is an excerpt for some of the the designs I have so far.
The signals in the code above have the following characteristics:
Please share your thoughts on this idea or show us a new idea that you come up about this topic.
-- Perbone
The text was updated successfully, but these errors were encountered: