Reference Codebot.Render.Graphics.pas
Part of the Codebot Render package
The Codebot.Render.Graphics unit gives you ICanvas, which draws smooth antialiased 2D vector graphics with OpenGL using Codebot.Render.NanoVG. You build up a path with MoveTo, LineTo, Rect, RoundRect, Circle, Ellipse, and the other path methods, and then Fill or Stroke it with a color, a pen, or a brush. The canvas also draws images, sprites, and text, and its matrix lets you rotate, scale, and move what you draw. Drawing happens between two calls to Flip on the canvas's IBackBuffer.
| Interface | Description |
|---|---|
| IPen | Strokes paths. |
| ISolidBrush, ILinearGradientBrush, IRadialGradientBrush, IBoxGradientBrush, IBitmapBrush | Fill paths with a color, a gradient, or an image. |
| IFont | Describes how text is drawn. |
| IBitmap | An image. IRenderBitmap is an image you can draw into. |
| ISprite | Draws one cell of a sprite sheet. |
| ITextWriter | Writes formatted text over several lines. |
| IMatrix | A 2D transform. |
NewCanvas, NewPen, NewBrush, NewSprite, NewMatrix, NewColorF, NewHSL, and the other New routines create them. A canvas must be created and used while an OpenGL context is current, which the scene hosts take care of for you.
Items 295 items
| Name | Kind | Line |
|---|---|---|
| BitmapsCreated | variable | 36 |
| BitmapsDestroyed | variable | 37 |
| Clamp | function | 653 |
| FontsCreated | variable | 34 |
| FontsDestroyed | variable | 35 |
| IBackBuffer | interface | 642 |
| BeginFrame | procedure | 645 |
| EndFrame | procedure | 647 |
| Flip | procedure | 649 |
| IBitmap | interface | 131 |
| GetClientRect | function | 135 |
| GetHeight | function | 137 |
| GetName | function | 134 |
| GetWidth | function | 136 |
| ClientRect | property | 142 |
| Height | property | 145 |
| Name | property | 140 |
| Width | property | 144 |
| IBitmapBrush | interface | 348 |
| GetAngle | function | 353 |
| GetBitmap | function | 351 |
| GetOffset | function | 355 |
| GetOpacity | function | 359 |
| GetScale | function | 357 |
| SetAngle | procedure | 354 |
| SetBitmap | procedure | 352 |
| SetOffset | procedure | 356 |
| SetOpacity | procedure | 360 |
| SetScale | procedure | 358 |
| Angle | property | 365 |
| Bitmap | property | 363 |
| Offset | property | 367 |
| Opacity | property | 371 |
| Scale | property | 369 |
| IBoxGradientBrush | interface | 324 |
| GetFeather | function | 331 |
| GetRadius | function | 329 |
| GetRect | function | 327 |
| SetFeather | procedure | 332 |
| SetRadius | procedure | 330 |
| SetRect | procedure | 328 |
| Feather | property | 339 |
| Radius | property | 337 |
| Rect | property | 335 |
| IBrush | interface | 244 |
| ICanvas | interface | 534 |
| Arc | procedure | 596 |
| ArcTo | procedure | 590 |
| BeginPath | procedure | 581 |
| BezierTo | procedure | 592 |
| Circle | procedure | 598 |
| Clear | procedure | 563 |
| Clip | procedure | 558, 560 |
| ClosePath | procedure | 584 |
| DrawImage | procedure | 575, 577 |
| DrawSprite | procedure | 579 |
| DrawText | procedure | 571 |
| DrawTextMemo | procedure | 573 |
| Ellipse | procedure | 600, 601 |
| Fill | procedure | 613, 614 |
| FillCircle | procedure | 619 |
| FillRect | procedure | 621 |
| FillRoundRect | procedure | 623 |
| GetBlendMode | function | 537 |
| GetFillRule | function | 547 |
| GetMatrix | function | 541 |
| GetOpacity | function | 539 |
| GetTextScale | function | 543 |
| GetWinding | function | 545 |
| LineTo | procedure | 588 |
| MeasureAdvance | function | 567 |
| MeasureMemo | function | 569 |
| MeasureText | function | 565 |
| MoveTo | procedure | 586 |
| Polygon | procedure | 609 |
| Pop | procedure | 553 |
| Push | procedure | 551 |
| QuadTo | procedure | 594 |
| Rect | procedure | 603, 604 |
| RoundRect | procedure | 606, 607 |
| RoundRectVarying | procedure | 611 |
| SetBlendMode | procedure | 538 |
| SetFillRule | procedure | 548 |
| SetMatrix | procedure | 542 |
| SetOpacity | procedure | 540 |
| SetTextScale | procedure | 544 |
| SetWinding | procedure | 546 |
| Stroke | procedure | 616, 617 |
| StrokeCircle | procedure | 620 |
| StrokeRect | procedure | 622 |
| StrokeRoundRect | procedure | 624 |
| BlendMode | property | 626 |
| FillRule | property | 637 |
| Matrix | property | 630 |
| Opacity | property | 628 |
| TextScale | property | 633 |
| Winding | property | 635 |
| IFont | interface | 168 |
| GetAlign | function | 178 |
| GetBlur | function | 182 |
| GetColor | function | 172 |
| GetHeight | function | 176 |
| GetLayout | function | 180 |
| GetLetterSpacing | function | 184 |
| GetLineSpacing | function | 186 |
| GetName | function | 171 |
| GetSize | function | 174 |
| SetAlign | procedure | 179 |
| SetBlur | procedure | 183 |
| SetColor | procedure | 173 |
| SetHeight | procedure | 177 |
| SetLayout | procedure | 181 |
| SetLetterSpacing | procedure | 185 |
| SetLineSpacing | procedure | 187 |
| SetSize | procedure | 175 |
| Align | property | 198 |
| Blur | property | 202 |
| Color | property | 192 |
| Height | property | 196 |
| Layout | property | 200 |
| LetterSpacing | property | 204 |
| LineSpacing | property | 206 |
| Name | property | 190 |
| Size | property | 194 |
| IGradientBrush | interface | 278 |
| GetFarStop | function | 282 |
| GetNearStop | function | 281 |
| FarStop | property | 287 |
| NearStop | property | 285 |
| IGradientStop | interface | 262 |
| GetColor | function | 267 |
| GetOffset | function | 265 |
| SetColor | procedure | 268 |
| SetOffset | procedure | 266 |
| Color | property | 273 |
| Offset | property | 271 |
| ILinearGradientBrush | interface | 293 |
| GetA | function | 296 |
| GetB | function | 298 |
| SetA | procedure | 297 |
| SetB | procedure | 299 |
| A | property | 302 |
| B | property | 304 |
| IMatrix | interface | 85 |
| Copy | procedure | 88, 90 |
| Identity | procedure | 92 |
| Inverse | function | 94 |
| Multiply | function | 114, 118 |
| Pop | procedure | 122 |
| Push | procedure | 120 |
| Rotate | procedure | 98 |
| RotateAt | procedure | 100 |
| Scale | procedure | 102 |
| ScaleAt | procedure | 104 |
| SkewX | procedure | 106 |
| SkewY | procedure | 108 |
| Transform | procedure | 110 |
| Translate | procedure | 96 |
| IPen | interface | 212 |
| GetBrush | function | 217 |
| GetColor | function | 215 |
| GetLineCap | function | 223 |
| GetLineJoin | function | 225 |
| GetMiterLimit | function | 221 |
| GetWidth | function | 219 |
| SetBrush | procedure | 218 |
| SetColor | procedure | 216 |
| SetLineCap | procedure | 224 |
| SetLineJoin | procedure | 226 |
| SetMiterLimit | procedure | 222 |
| SetWidth | procedure | 220 |
| Brush | property | 231 |
| Color | property | 229 |
| LineCap | property | 237 |
| LineJoin | property | 239 |
| MiterLimit | property | 235 |
| Width | property | 233 |
| IRadialGradientBrush | interface | 310 |
| GetRect | function | 313 |
| SetRect | procedure | 314 |
| Rect | property | 317 |
| IRenderBitmap | interface | 156 |
| Bind | procedure | 159 |
| Resize | procedure | 163 |
| Unbind | procedure | 161 |
| IResourceStore | interface | 472 |
| DisposeBitmap | procedure | 509 |
| LoadBitmap | function | 483, 489, 492, 497 |
| LoadBitmapAsset | function | 506 |
| LoadBitmapResource | function | 500 |
| LoadFont | function | 512, 515, 517 |
| LoadFontAsset | function | 523 |
| LoadFontResource | function | 519 |
| NewBitmap | function | 480 |
| NewTextWriter | function | 475, 477 |
| ISolidBrush | interface | 250 |
| GetColor | function | 253 |
| SetColor | procedure | 254 |
| Color | property | 257 |
| ISprite | interface | 377 |
| GetBitmap | function | 380 |
| GetCell | function | 386 |
| GetCols | function | 382 |
| GetOpacity | function | 396 |
| GetPivot | function | 388 |
| GetPosition | function | 390 |
| GetRotation | function | 392 |
| GetRows | function | 384 |
| GetScale | function | 394 |
| SetBitmap | procedure | 381 |
| SetCell | procedure | 387 |
| SetCols | procedure | 383 |
| SetOpacity | procedure | 397 |
| SetPivot | procedure | 389 |
| SetPosition | procedure | 391 |
| SetRotation | procedure | 393 |
| SetRows | procedure | 385 |
| SetScale | procedure | 395 |
| Bitmap | property | 400 |
| Cell | property | 408 |
| Cols | property | 402 |
| Opacity | property | 419 |
| Pivot | property | 411 |
| Position | property | 413 |
| Rotation | property | 415 |
| Rows | property | 404 |
| Scale | property | 417 |
| ITextWriter | interface | 443 |
| GetShadow | function | 445 |
| Indent | procedure | 450 |
| NewLine | procedure | 454 |
| NewPage | procedure | 452 |
| Paper | procedure | 448 |
| SetShadow | procedure | 446 |
| Write | procedure | 456 |
| WriteAt | procedure | 462 |
| WriteColumn | procedure | 458 |
| WriteLine | procedure | 460 |
| Shadow | property | 464 |
| MatrixCreated | variable | 32 |
| MatrixDestroyed | variable | 33 |
| MatrixPushPop | variable | 31 |
| NewBrush | function | 667, 668, 669, 670, 671 |
| NewCanvas | function | 675 |
| NewColorB | function | 657 |
| NewColorF | function | 658 |
| NewHSL | function | 659 |
| NewMatrix | function | 664 |
| NewPen | function | 665, 666 |
| NewPointF | function | 660 |
| NewRectF | function | 661, 662 |
| NewSprite | function | 673 |
| PointZero | constant | 680 |
| RectEmpty | constant | 681 |
| TBlendMode | enum | 80 |
| blendAlpha | enum value | 80 |
| blendAdditive | enum value | 80 |
| blendSubtractive | enum value | 80 |
| blendLighten | enum value | 81 |
| blendDarken | enum value | 81 |
| blendInvert | enum value | 81 |
| blendNegative | enum value | 81 |
| TFillRule | enum | 76 |
| fillWinding | enum value | 76 |
| fillNonZero | enum value | 76 |
| fillEvenOdd | enum value | 76 |
| TFontAlign | enum | 64 |
| fontLeft | enum value | 64 |
| fontCenter | enum value | 64 |
| fontRight | enum value | 64 |
| TFontLayout | enum | 66 |
| fontTop | enum value | 66 |
| fontMiddle | enum value | 66 |
| fontBaseline | enum value | 66 |
| fontBottom | enum value | 66 |
| TLineCap | enum | 62 |
| capButt | enum value | 62 |
| capSquare | enum value | 62 |
| capRound | enum value | 62 |
| TLineJoin | enum | 60 |
| joinMiter | enum value | 60 |
| joinBevel | enum value | 60 |
| joinRound | enum value | 60 |
| TTextLayout | enum | 425 |
| textLeft | enum value | 427 |
| textTop | enum value | 429 |
| textRight | enum value | 431 |
| textBottom | enum value | 433 |
| textMiddleLeft | enum value | 435 |
| textMiddle | enum value | 437 |
| textMiddleRight | enum value | 439 |
| textMemo | enum value | 441 |
| TWinding | enum | 68 |
| windCCW | enum value | 68 |
| windCW | enum value | 68 |