Skip to content

Commit 3c69504

Browse files
committed
update to 1.2.180
1 parent 824e1ea commit 3c69504

114 files changed

Lines changed: 24283 additions & 10169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DefoldDocs/api/base.lua

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,40 @@
99
---@field z number
1010
---@field w number
1111

12+
---@class quaternion
13+
---@field x number
14+
---@field y number
15+
---@field z number
16+
---@field w number
17+
18+
---@alias quat quaternion
19+
1220
---@class url
1321
---@field socket
1422
---@field path
1523
---@field fragment
1624

25+
---@alias hash userdata
26+
---@alias constant userdata
27+
---@alias bool boolean
28+
---@alias float number
29+
---@alias object userdata
30+
---@alias matrix4 userdata
31+
---@alias node userdata
32+
33+
--mb use number instead of vector4
34+
---@alias vector vector4
35+
36+
--luasocket
37+
---@alias master userdata
38+
---@alias unconnected userdata
39+
---@alias client userdata
40+
41+
--render
42+
---@alias constant_buffer userdata
43+
---@alias render_target userdata
44+
---@alias predicate userdata
45+
1746
--- Calls error if the value of its argument `v` is false (i.e., **nil** or
1847
--- **false**); otherwise, returns all its arguments. In case of error,
1948
--- `message` is the error object; when absent, it defaults to "assertion

DefoldDocs/api/bitop.lua

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---Bitwise operations API documentation
22
---Lua BitOp <http://bitop.luajit.org/api.html> is a C extension module for Lua 5.1/5.2 which adds bitwise operations on numbers.
3-
---
43
---Lua BitOp is Copyright © 2008-2012 Mike Pall.
54
---Lua BitOp is free software, released under the MIT license (same license as the Lua core).
6-
---
75
---Lua BitOp is compatible with the built-in bitwise operations in LuaJIT 2.0 and is used
86
---on platforms where Defold runs without LuaJIT.
9-
---
107
---For clarity the examples assume the definition of a helper function printx().
118
---This prints its argument as an unsigned 32 bit hexadecimal number on all platforms:
129
---function printx(x)
@@ -22,59 +19,70 @@ bit = {}
2219
---@param n number number of bits
2320
---@return number bitwise arithmetic right-shifted number
2421
function bit.arshift(x, n) end
22+
2523
---Returns the bitwise and of all of its arguments. Note that more than two arguments are allowed.
2624
---@param x1 number number
27-
---@param ... number number(s)
25+
--- ... number number(s)
2826
---@return number bitwise and of the provided arguments
2927
function bit.band(x1, ...) end
28+
3029
---Returns the bitwise not of its argument.
3130
---@param x number number
3231
---@return number bitwise not of number x
3332
function bit.bnot(x) end
33+
3434
---Returns the bitwise or of all of its arguments. Note that more than two arguments are allowed.
3535
---@param x1 number number
36-
---@param ... number number(s)
36+
--- ... number number(s)
3737
---@return number bitwise or of the provided arguments
3838
function bit.bor(x1, ...) end
39+
3940
---Swaps the bytes of its argument and returns it. This can be used to convert little-endian 32 bit numbers to big-endian 32 bit numbers or vice versa.
4041
---@param x number number
4142
---@return number bitwise swapped number
4243
function bit.bswap(x) end
44+
4345
---Returns the bitwise xor of all of its arguments. Note that more than two arguments are allowed.
4446
---@param x1 number number
45-
---@param ... number number(s)
47+
--- ... number number(s)
4648
---@return number bitwise xor of the provided arguments
4749
function bit.bxor(x1, ...) end
50+
4851
---Returns the bitwise logical left-shift of its first argument by the number of bits given by the second argument.
4952
---Logical shifts treat the first argument as an unsigned number and shift in 0-bits.
5053
---Only the lower 5 bits of the shift count are used (reduces to the range [0..31]).
5154
---@param x number number
5255
---@param n number number of bits
5356
---@return number bitwise logical left-shifted number
5457
function bit.lshift(x, n) end
58+
5559
---Returns the bitwise left rotation of its first argument by the number of bits given by the second argument. Bits shifted out on one side are shifted back in on the other side.
5660
---Only the lower 5 bits of the rotate count are used (reduces to the range [0..31]).
5761
---@param x number number
5862
---@param n number number of bits
5963
---@return number bitwise left-rotated number
6064
function bit.rol(x, n) end
65+
6166
---Returns the bitwise right rotation of its first argument by the number of bits given by the second argument. Bits shifted out on one side are shifted back in on the other side.
6267
---Only the lower 5 bits of the rotate count are used (reduces to the range [0..31]).
6368
---@param x number number
6469
---@param n number number of bits
6570
---@return number bitwise right-rotated number
6671
function bit.ror(x, n) end
72+
6773
---Returns the bitwise logical right-shift of its first argument by the number of bits given by the second argument.
6874
---Logical shifts treat the first argument as an unsigned number and shift in 0-bits.
6975
---Only the lower 5 bits of the shift count are used (reduces to the range [0..31]).
7076
---@param x number number
7177
---@param n number number of bits
7278
---@return number bitwise logical right-shifted number
7379
function bit.rshift(x, n) end
80+
7481
---Normalizes a number to the numeric range for bit operations and returns it. This function is usually not needed since all bit operations already normalize all of their input arguments.
7582
---@param x number number to normalize
7683
---@return number normalized number
7784
function bit.tobit(x) end
85+
7886
---Converts its first argument to a hex string. The number of hex digits is given by the absolute value of the optional second argument. Positive numbers between 1 and 8 generate lowercase hex digits. Negative numbers generate uppercase hex digits. Only the least-significant 4*|n| bits are used. The default is to generate 8 lowercase hex digits.
7987
---@param x number number to convert
8088
---@param n number number of hex digits to return
@@ -83,4 +91,5 @@ function bit.tohex(x, n) end
8391

8492

8593

94+
8695
return bit

DefoldDocs/api/built-ins.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ builtins = {}
77
---@param s string string to hash
88
---@return hash a hashed string
99
function hash(s) end
10+
1011
---Returns a hexadecimal representation of a hash value.
1112
---The returned string is always padded with leading zeros.
1213
---@param h hash hash value to get hex string for
1314
---@return string hex representation of the hash
1415
function hash_to_hex(h) end
16+
1517
---Pretty printing of Lua values. This function prints Lua values
1618
---in a manner similar to +print()+, but will also recurse into tables
1719
---and pretty print them. There is a limit to how deep the function
@@ -21,4 +23,5 @@ function pprint(v) end
2123

2224

2325

26+
2427
return builtins

DefoldDocs/api/collection_factory.lua

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,45 @@ collectionfactory.STATUS_LOADING = nil
1010
---unloaded
1111
collectionfactory.STATUS_UNLOADED = nil
1212
---The URL identifies the collectionfactory component that should do the spawning.
13-
---
1413
---Spawning is instant, but spawned game objects get their first update calls the following frame. The supplied parameters for position, rotation and scale
1514
---will be applied to the whole collection when spawned.
16-
---
1715
---Script properties in the created game objects can be overridden through
1816
---a properties-parameter table. The table should contain game object ids
1917
---(hash) as keys and property tables as values to be used when initiating each
2018
---spawned game object.
21-
---
2219
---See go.property for more information on script properties.
23-
---
2420
---The function returns a table that contains a key for each game object
2521
---id (hash), as addressed if the collection file was top level, and the
2622
---corresponding spawned instance id (hash) as value with a unique path
2723
---prefix added to each instance.
28-
---
2924
--- Calling collectionfactory.create <> create on a collection factory that is marked as dynamic without having loaded resources
3025
---using collectionfactory.load <> will synchronously load and create resources which may affect application performance.
31-
---@param url string | hash | url the collection factory component to be used
26+
---@param url string|hash|url the collection factory component to be used
3227
---@param position vector3 position to assign to the newly spawned collection
3328
---@param rotation quaternion rotation to assign to the newly spawned collection
3429
---@param properties table table of script properties to propagate to any new game object instances
3530
---@param scale number uniform scaling to apply to the newly spawned collection (must be greater than 0).
3631
---@return table a table mapping the id:s from the collection to the new instance id:s
3732
function collectionfactory.create(url, position, rotation, properties, scale) end
33+
3834
---This returns status of the collection factory.
39-
---
4035
---Calling this function when the factory is not marked as dynamic loading always returns COMP_COLLECTION_FACTORY_STATUS_LOADED.
41-
---@param url string | hash | url the collection factory component to get status from
36+
---@param url string|hash|url the collection factory component to get status from
4237
---@return constant status of the collection factory component
4338
function collectionfactory.get_status(url) end
39+
4440
---Resources loaded are referenced by the collection factory component until the existing (parent) collection is destroyed or collectionfactory.unload is called.
45-
---
4641
---Calling this function when the factory is not marked as dynamic loading does nothing.
47-
---@param url string | hash | url the collection factory component to load
42+
---@param url string|hash|url the collection factory component to load
4843
---@param complete_function function(self, url, result)) function to call when resources are loaded.
4944
function collectionfactory.load(url, complete_function) end
45+
5046
---This decreases the reference count for each resource loaded with collectionfactory.load. If reference is zero, the resource is destroyed.
51-
---
5247
---Calling this function when the factory is not marked as dynamic loading does nothing.
53-
---@param url string | hash | url the collection factory component to unload
48+
---@param url string|hash|url the collection factory component to unload
5449
function collectionfactory.unload(url) end
5550

5651

5752

53+
5854
return collectionfactory

DefoldDocs/api/collection_proxy.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ function collectionproxy.missing_resources(collectionproxy) end
1616

1717

1818

19+
1920
return collectionproxy

DefoldDocs/api/collision_object.lua

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,53 @@ physics.JOINT_TYPE_SLIDER = nil
1313
---spring joint type
1414
physics.JOINT_TYPE_SPRING = nil
1515
---Create a physics joint between two collision object components.
16-
---
1716
---Note: Currently only supported in 2D physics.
1817
---@param joint_type number the joint type
19-
---@param collisionobject_a string | hash | url first collision object
20-
---@param joint_id string | hash id of the joint
18+
---@param collisionobject_a string|hash|url first collision object
19+
---@param joint_id string|hash id of the joint
2120
---@param position_a vector3 local position where to attach the joint on the first collision object
22-
---@param collisionobject_b string | hash | url second collision object
21+
---@param collisionobject_b string|hash|url second collision object
2322
---@param position_b vector3 local position where to attach the joint on the second collision object
24-
---@param properties table optional joint specific properties table
23+
---@param properties table optional joint specific properties table See each joint type for possible properties field. The one field that is accepted for all joint types is: - boolean collide_connected: Set this flag to true if the attached bodies should collide.
2524
function physics.create_joint(joint_type, collisionobject_a, joint_id, position_a, collisionobject_b, position_b, properties) end
25+
2626
---Destroy an already physics joint. The joint has to be created before a
2727
---destroy can be issued.
28-
---
2928
---Note: Currently only supported in 2D physics.
30-
---@param collisionobject string | hash | url collision object where the joint exist
31-
---@param joint_id string | hash id of the joint
29+
---@param collisionobject string|hash|url collision object where the joint exist
30+
---@param joint_id string|hash id of the joint
3231
function physics.destroy_joint(collisionobject, joint_id) end
32+
3333
---Get the gravity in runtime. The gravity returned is not global, it will return
3434
---the gravity for the collection that the function is called from.
35-
---
3635
---Note: For 2D physics the z component will always be zero.
37-
---@return [type:vector3] gravity vector of collection
36+
---@return vector3 gravity vector of collection
3837
function physics.get_gravity() end
38+
3939
---Get a table for properties for a connected joint. The joint has to be created before
4040
---properties can be retrieved.
41-
---
4241
---Note: Currently only supported in 2D physics.
43-
---@param collisionobject string | hash | url collision object where the joint exist
44-
---@param joint_id string | hash id of the joint
45-
---@return boolean
42+
---@param collisionobject string|hash|url collision object where the joint exist
43+
---@param joint_id string|hash id of the joint
44+
---@return table properties table. See the joint types for what fields are available, the only field available for all types is:
4645
function physics.get_joint_properties(collisionobject, joint_id) end
46+
4747
---Get the reaction force for a joint. The joint has to be created before
4848
---the reaction force can be calculated.
49-
---
5049
---Note: Currently only supported in 2D physics.
51-
---@param collisionobject string | hash | url collision object where the joint exist
52-
---@param joint_id string | hash id of the joint
50+
---@param collisionobject string|hash|url collision object where the joint exist
51+
---@param joint_id string|hash id of the joint
5352
---@return vector3 reaction force for the joint
5453
function physics.get_joint_reaction_force(collisionobject, joint_id) end
54+
5555
---Get the reaction torque for a joint. The joint has to be created before
5656
---the reaction torque can be calculated.
57-
---
5857
---Note: Currently only supported in 2D physics.
59-
---@param collisionobject string | hash | url collision object where the joint exist
60-
---@param joint_id string | hash id of the joint
58+
---@param collisionobject string|hash|url collision object where the joint exist
59+
---@param joint_id string|hash id of the joint
6160
---@return float the reaction torque on bodyB in N*m.
6261
function physics.get_joint_reaction_torque(collisionobject, joint_id) end
62+
6363
---Ray casts are used to test for intersections against collision objects in the physics world.
6464
---Collision objects of types kinematic, dynamic and static are tested against. Trigger objects
6565
---do not intersect with ray casts.
@@ -68,8 +68,10 @@ function physics.get_joint_reaction_torque(collisionobject, joint_id) end
6868
---@param from vector3 the world position of the start of the ray
6969
---@param to vector3 the world position of the end of the ray
7070
---@param groups table a lua table containing the hashed groups for which to test collisions against
71-
---@return table It returns a table. If missed it returns nil. See
72-
function physics.raycast(from, to, groups) end
71+
---@param options table a lua table containing options for the raycast.
72+
---@return table It returns a list. If missed it returns nil. See ray_cast_response for details on the returned values.
73+
function physics.raycast(from, to, groups, options) end
74+
7375
---Ray casts are used to test for intersections against collision objects in the physics world.
7476
---Collision objects of types kinematic, dynamic and static are tested against. Trigger objects
7577
---do not intersect with ray casts.
@@ -81,35 +83,37 @@ function physics.raycast(from, to, groups) end
8183
--- * If an object is hit, the result will be reported via a ray_cast_response message.
8284
---
8385
--- * If there is no object hit, the result will be reported via a ray_cast_missed message.
84-
8586
---@param from vector3 the world position of the start of the ray
8687
---@param to vector3 the world position of the end of the ray
8788
---@param groups table a lua table containing the hashed groups for which to test collisions against
88-
---@param request_id number a number between [0,-255]. It will be sent back in the response for identification, 0 by default
89+
---@param request_id number] a number between [0,-255 . It will be sent back in the response for identification, 0 by default
8990
function physics.raycast_async(from, to, groups, request_id) end
91+
9092
---Set the gravity in runtime. The gravity change is not global, it will only affect
9193
---the collection that the function is called from.
92-
---
9394
---Note: For 2D physics the z component of the gravity vector will be ignored.
9495
---@param gravity vector3 the new gravity vector
9596
function physics.set_gravity(gravity) end
97+
9698
---Flips the collision shapes horizontally for a collision object
97-
---@param url string | hash | url the collision object that should flip its shapes
98-
---@param flip boolean
99+
---@param url string|hash|url the collision object that should flip its shapes
100+
---@param flip boolean true if the collision object should flip its shapes, false if not
99101
function physics.set_hflip(url, flip) end
102+
100103
---Updates the properties for an already connected joint. The joint has to be created before
101104
---properties can be changed.
102-
---
103105
---Note: Currently only supported in 2D physics.
104-
---@param collisionobject string | hash | url collision object where the joint exist
105-
---@param joint_id string | hash id of the joint
106-
---@param properties table joint specific properties table
106+
---@param collisionobject string|hash|url collision object where the joint exist
107+
---@param joint_id string|hash id of the joint
108+
---@param properties table joint specific properties table Note: The collide_connected field cannot be updated/changed after a connection has been made.
107109
function physics.set_joint_properties(collisionobject, joint_id, properties) end
110+
108111
---Flips the collision shapes vertically for a collision object
109-
---@param url string | hash | url the collision object that should flip its shapes
110-
---@param flip boolean
112+
---@param url string|hash|url the collision object that should flip its shapes
113+
---@param flip boolean true if the collision object should flip its shapes, false if not
111114
function physics.set_vflip(url, flip) end
112115

113116

114117

118+
115119
return physics

DefoldDocs/api/facebook.lua

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)