< Previous | Contents | Next >

Example

The Create function below shows a rectangle control associated with separate width, height and radius sliders


image

function Create()

InCenter = self:AddInput("Center", "Center", { LINKID_DataType = "Point", INPID_InputControl = "OffsetControl", INPID_PreviewControl = "CrosshairControl",

})


InWidth = self:AddInput("Width", "Width", { LINKID_DataType = "Number", INPID_InputControl = "SliderControl", INPID_PreviewControl = "RectangleControl", PC_ControlGroup = 1.0,

PC_ControlID = 0,

INP_MaxScale = 2,

INP_Default = 1.0,

})


InHeight = self:AddInput("Height", "Height", { LINKID_DataType = "Number", INPID_InputControl = "SliderControl", INPID_PreviewControl = "RectangleControl", PC_ControlGroup = 1.0,

PC_ControlID = 1,

INP_MaxScale = 2,

INP_Default = 1.0,

})


InRadius = self:AddInput("Corner Radius", "CornerRadius", { LINKID_DataType = "Number",

INPID_InputControl = "SliderControl", INPID_PreviewControl = "RectangleControl", PC_ControlGroup = 1.0,

PC_ControlID = 2,

INP_MaxScale = 0.2,

INP_Default = 0.0,

})


InAngle = self:AddInput("Angle", "Angle", { LINKID_DataType = "Number", INPID_InputControl = "ScrewControl", INPID_PreviewControl = "AngleControl", INP_MinScale = 0.0,

INP_MaxScale = 360.0,

INP_Default = 0.0, ACP_Center = InCenter,

})


InWidth:SetAttrs({

RCP_Center = InCenter, RCP_Angle = InAngle,

})


InImage = self:AddInput("Input", "Input", { LINKID_DataType = "Image", LINK_Main = 1,

})


OutImage = self:AddOutput("Output", "Output", { LINKID_DataType = "Image",

LINK_Main = 1,

})

end