Browse Source

Minor typo correction on Lua scripting documentation page.

Yao Wei Tjong 姚伟忠 10 years ago
parent
commit
b202aa6ee7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Docs/Reference.dox

+ 1 - 1
Docs/Reference.dox

@@ -788,7 +788,7 @@ print(myMap[hash].typeName, myMap[hash]:GetVector2():Length())
 
 As shown in the above example, you can either use GetRawBuffer() or GetBuffer() to get the unsigned char array stored in a variant object. It also shows that VariantMap is capable of converting a Lua table containing an array of unsigned char to a variant object stored as buffer. You may want to know that it is capable of converting a Lua table containing an array of variant objects or an array of string objects to be stored as VariantVector and StringVector, respectively, as well. It also converts any Lua primitive data types and all Urho3D classes that are exposed to Lua like all the math classes, reference counted classes, POD classes, resource reference class. etc.
 
-Inline with C++ and AngelScript, in Lua you have to call one of the %Variant's getter method to "unbox" the actual object stored inside a %Variant object. However, specifically in Lua, there is a generic Get() method which takes advantage of Lua being type less, so the method can unbox a %Variant object and assign the return object to a type less Lua object. It takes one optional string parameter representing a Lua user type that the method would use to cast the return object into. The parameter is used for cases where a type casting is required when returning object from %Variant object stroring a void pointer or a refcounted pointer and for the case of requesting a %VectorBuffer to be returned for %Variant object storing an unsigned char buffer. The parameter is ignored for all other cases. Following up to use the same example above, we can index the map and access the stored objects as so:
+Inline with C++ and AngelScript, in Lua you have to call one of the %Variant's getter method to "unbox" the actual object stored inside a %Variant object. However, specifically in Lua, there is a generic Get() method which takes advantage of Lua being type less, so the method can unbox a %Variant object and assign the return object to a type less Lua object. It takes one optional string parameter representing a Lua user type that the method would use to cast the return object into. The parameter is used for cases where a type casting is required when returning object from %Variant object storing a void pointer or a refcounted pointer and for the case of requesting a %VectorBuffer to be returned for %Variant object storing an unsigned char buffer. The parameter is ignored for all other cases. Following up to use the same example above, we can index the map and access the stored objects as so:
 
 \code
 print(myMap[1]:Get("Spline").interpolationMode)