From be89efe77a7987a426fbae3b4bc878c1247162ad Mon Sep 17 00:00:00 2001 From: YungDaVinci Date: Thu, 5 Feb 2015 19:33:23 -0500 Subject: [PATCH] Create Quad.lua --- .../Examples/Example_Actors/Quad.lua | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Docs/Themerdocs/Examples/Example_Actors/Quad.lua diff --git a/Docs/Themerdocs/Examples/Example_Actors/Quad.lua b/Docs/Themerdocs/Examples/Example_Actors/Quad.lua new file mode 100644 index 0000000000..a5aa31d54f --- /dev/null +++ b/Docs/Themerdocs/Examples/Example_Actors/Quad.lua @@ -0,0 +1,22 @@ +-- A simple quad example. +-- Quads are used to create… well, quads. + +Def.Quad{ + -- Quads have no special attributes, but they do have a few special functions. + OnCommand=function(self) + self:SetWidth(40) -- scales the quad’s width to 40 + self:SetHeight(40) -- scales the quad’s height to 40 + -- SetWidth and SetHeight must be capitalized to work. + -- SetSize (or setsize) is a shorthand for SetWidth and SetHeight. + -- The syntax is setsize(x, y), where x is the width and y is the height. + -- The default width and height is 1, which is less than 1 pixel on some displays + + self:diffuse(color(Red)) + -- Sets the color to red. +-- A list of all possible names for the colors can be found in + -- Themes/_fallback/Scripts/02 Colors.lua + + self:Center() + -- places the quad in the middle of the screen + end +}