Files
itgmania212121/Docs/Themerdocs/Examples/Example_Actors/Quad.lua
T
2015-02-05 19:33:23 -05:00

23 lines
826 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 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 quads width to 40
self:SetHeight(40) -- scales the quads 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
}