Advertisement
Derek1017

Test

Jul 10th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. -- Example 5
  2. ImagePrototype = {data="Original"}
  3.  
  4. function ImagePrototype.__init__ (baseClass, data)
  5.   self = {data=data}
  6.   setmetatable (self, {__index=ImagePrototype})
  7.   return self
  8. end
  9.  
  10. setmetatable (ImagePrototype, {__call=ImagePrototype.__init__}) --Makes ImagePrototype(...) act like ImagePrototype.__init__ (ImagePrototype, ...)
  11.  
  12. function ImagePrototype:printData ()
  13.   print (self.data)  
  14. end
  15.  
  16. local image1 = ImagePrototype ("1,1,Black;")
  17. image1:printData()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement