Clone wiki

FlowGUI / Rectangle

Description

A rectangle is a colored square. Rectangle can be used for background canvas or for simply drawing
out a mockup for where you want GUI elements to appear.

Functions

  • FG_Rectangle:Create() --Creates a new rectangle
  • SetColor(Vec4 color) --Set color that is used to draw the rectangle with.
  • GetColor() --Returns the color of the rectangle.

Example

Script.rectColor = Vec4(0,0,0,0) --color "Rectangle color"
Script.rectangle1 = nil

function Script:Start()
   --Create a rectangle
    self.rectangle1 = FG_Rectangle:Create()
    self.rectangle1:SetPosition(Vec2(600, 660))
    self.rectangle1:SetScale(Vec2(250, 60))
    self.rectangle1:SetColor(self.rectColor)
    guiManager:AddElement(self.rectangle1)
end

Updated