Image that can be drawn. This image can be drawn in various rendering methods and events, e.g. inside overridden TCastleUserInterface.Render.
We have a few (probably too many) ways to show a 2D image. Alternatives to TDrawableImage
are:
|
class procedure BatchingBegin; |
|
class procedure BatchingEnd; |
|
class procedure BatchingFlush; |
|
constructor Create(const AImage: TEncodedImage; const ASmoothScaling: boolean; const AOwnsImage: boolean); overload; |
|
constructor Create(const AUrl: String; const ASmoothScaling: boolean = true); overload; |
|
constructor Create(const AUrl: String; const LoadAsClass: array of TEncodedImageClass; const ResizeToX: Cardinal = 0; const ResizeToY: Cardinal = 0; const Interpolation: TResizeInterpolation = riBilinear); overload; |
|
constructor Create(const AUrl: String; const LoadAsClass: array of TEncodedImageClass; const ASmoothScaling: boolean); overload; |
|
destructor Destroy; override; |
|
function Rect: TRectangle; |
|
procedure Draw(const X, Y: Single); overload; |
|
procedure Draw(const X, Y, DrawWidth, DrawHeight: Single); overload; |
|
procedure Draw(const X, Y, DrawWidth, DrawHeight: Single; const ImageX, ImageY, ImageWidth, ImageHeight: Single); overload; |
|
procedure Draw(const Pos: TVector2Integer); overload; |
|
procedure Draw(const ScreenRect: TFloatRectangle); overload; |
|
procedure Draw(const ScreenRect, ImageRect: TFloatRectangle); overload; |
|
procedure Draw(const ScreenRect: TRectangle); overload; |
|
procedure Draw(const ScreenRect: TRectangle; const ImageX, ImageY, ImageWidth, ImageHeight: Single); overload; |
|
procedure Draw(const ScreenRect, ImageRect: TRectangle); overload; |
|
procedure Draw(ScreenRects, ImageRects: PFloatRectangleArray; Count: Integer); overload; virtual; |
|
procedure DrawFlipped(const ScreenRect: TRectangle; const FlipHorizontal, FlipVertical: boolean); overload; |
|
procedure DrawFlipped(const ScreenRect: TFloatRectangle; const FlipHorizontal, FlipVertical: boolean); overload; |
|
procedure DrawFlipped(const ScreenRect: TFloatRectangle; ImageRect: TFloatRectangle; const FlipHorizontal, FlipVertical: boolean); overload; |
|
procedure Draw3x3(const X, Y, DrawWidth, DrawHeight: Single; CornerTop, CornerRight, CornerBottom, CornerLeft: Single; ImageLeft: Single = 0; ImageBottom: Single = 0; ImageWidth: Single = -1; ImageHeight: Single = -1); overload; |
|
procedure Draw3x3(const X, Y, DrawWidth, DrawHeight: Single; const Corner: TVector4Integer; const ImageRect: TFloatRectangle); overload; |
|
procedure Draw3x3(const ScreenRect: TRectangle; const Corner: TVector4Integer; const ImageRect: TFloatRectangle); overload; |
|
procedure Draw3x3(const ScreenRect: TFloatRectangle; const Corner: TVector4Integer; const ImageRect: TFloatRectangle); overload; |
|
procedure Draw3x3(const ScreenRect: TFloatRectangle; const Corner: TVector4; const ImageRect: TFloatRectangle); overload; |
|
procedure Draw3x3(const X, Y, DrawWidth, DrawHeight: Single; const Corner: TVector4Integer); overload; |
|
procedure Draw3x3(const ScreenRect: TRectangle; const Corner: TVector4Integer); overload; |
|
procedure Draw3x3(const ScreenRect: TFloatRectangle; const Corner: TVector4Integer); overload; |
|
procedure Draw3x3(const ScreenRect: TFloatRectangle; const Corner: TVector4); overload; |
|
procedure Load(const AImage: TEncodedImage); virtual; |
|
procedure PrepareResources; |
|
function GetContents(const ImageClass: TCastleImageClass): TCastleImage; |
|
procedure RenderToImageBegin(const SetAndRestoreViewport: boolean = true); |
|
procedure RenderToImageEnd; |
|
procedure RenderToImageFree; |
|
procedure DrawFrom(const SourceImage: TDrawableImage; const DestinationRect, SourceRect: TFloatRectangle); |
|
procedure Draw3x3(const X, Y, DrawWidth, DrawHeight: Single; CornerTop, CornerRight, CornerBottom, CornerLeft: Single; ImageLeft: Single = 0; ImageBottom: Single = 0; ImageWidth: Single = -1; ImageHeight: Single = -1); overload; |
Draw the image on the screen, divided into 3x3 parts for corners, sides, and inside.
Just like the regular Draw method, this fills a rectangle on the 2D screen, with bottom-left corner in (X, Y), and size (DrawWidth, DrawHeight). The image is divided into 3 * 3 = 9 parts:
4 corners, used to fill the corners of the screen rectangle. They are not stretched.
4 sides, used to fill the sides of the screen rectangle between the corners. They are scaled in one dimension, to fill the space between corners completely.
the inside. Used to fill the rectangular inside. Scaled in both dimensions as necessary.
|