From Clomosy Docs
(Created page with "<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> function AddNewRectangle(AComponent: TCLComponent; xName: string): TclRectangle; </div> <span style="color:blue"><b>AComponent</b></span> : The variable name of the defined component is written. Here you have to write the name of the component you want in it.<br> <span style="color:blue"><b>xName</b></span> : The name of the defined component should be written.<...") |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 3: | Line 3: | ||
</div> | </div> | ||
<span style="color:blue"><b>AComponent</b></span> : | <span style="color:blue"><b>AComponent</b></span> : Specifies the parent of the object to be defined.<br> | ||
<span style="color:blue"><b>xName</b></span> : The name of the defined component should be written.<br> | <span style="color:blue"><b>xName</b></span> : The name of the defined component should be written.<br> | ||
| Line 58: | Line 58: | ||
* [[Object Properties]] | * [[Object Properties]] | ||
* [[AddNewEvent]] | * [[AddNewEvent]] | ||
{{#seo:|title=TclRectangle Using in Clomosy - Clomosy Docs}} | |||
{{#seo:|description=Learn to use TclRectangle in Clomosy for customizable rectangles, ideal for backgrounds or regions, with flexible styling options.}} | |||
Latest revision as of 15:05, 24 December 2024
function AddNewRectangle(AComponent: TCLComponent; xName: string): TclRectangle;
AComponent : Specifies the parent of the object to be defined.
xName : The name of the defined component should be written.
The TclRectangle component represents a rectangle and is commonly used in interface designs as a background or region. Additionally, its appearance and properties can be customized using style properties.
| Feature | Use of | Definition |
|---|---|---|
| TclRectangle | Rectangle1 : TclRectangle; | A variable belonging to the TclCircle class is created. |
| AddNewRectangle | Rectangle1 = Form1.AddNewRectangle(Form1,'Rectangle1'); | A new TclRectangle is added to the form. |
| Fill.Kind | Rectangle1.Fill.Kind = fbkSolid; | It is used to fill the inside of the object. This property determines how the interior fill of the object is applied. The following options can be used:
|
| Fill.Bitmap.WrapMode | Rectangle1.Fill.Bitmap.WrapMode = fbwmTileOriginal; | It is used to specify a bitmap when filling the inside of the component and to control how this bitmap will be tiled. It determines how the bitmap will be placed and overlapped on a specific area. The following options can be used:
|
| Stroke.Thickness | Rectangle1.Stroke.Thickness = 3; | It is used to set the thickness of the object's border. A value of 0 disables the border. |
| Sides | Rectangle1.Sides = SetOf([sdLeft, sdTop, sdRight, sdBottom]); | The Sides property is used to customize the width adjustments for each side of the object. By using SetOf, the dimensions of all four sides are defined. As shown above, the parameters are provided sequentially for the left, top, right, and bottom sides. For sides where no frame is desired, the corresponding parameter is removed. |
Example
var
anaForm:TclGameForm;
Rectangle1: TclRectangle;
{
anaForm = TclGameForm.Create(Self);
Rectangle1 = anaForm.AddNewRectangle(anaForm, 'Rectangle1');
Rectangle1.Fill.Kind = fbkBitmap;
Rectangle1.Fill.Bitmap.WrapMode = fbwmTile;
Rectangle1.Width = 200;
Rectangle1.Height = 200;
Rectangle1.Stroke.Thickness = 3;
Rectangle1.Sides = SetOf([sdLeft, sdTop, sdBottom]);
anaForm.Run;
}