File: CastleGLImages.TGLImage.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (479 lines) | stat: -rw-r--r-- 31,950 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: CastleGLImages: Class TGLImage</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<a name="TGLImage"></a><h1 class="cio">Class TGLImage</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td>Fields</td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td><a class="section" href="#PasDoc-Properties">Properties</a></td></tr></table>
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
<p class="unitlink">
<a  href="CastleGLImages.html">CastleGLImages</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TGLImage = class(TObject)</code></p>
<h2 class="description">Description</h2>
<p>
Image ready to be drawn on 2D screen.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TObject</li>
<li class="thisitem">TGLImage</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <b><a  href="CastleGLImages.TGLImage.html#Create">Create</a></b>(const Image: <a  href="CastleImages.TEncodedImage.html">TEncodedImage</a>; const AScalingPossible: boolean = false);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <b><a  href="CastleGLImages.TGLImage.html#Create">Create</a></b>(const URL: string; const AScalingPossible: boolean = false);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <b><a  href="CastleGLImages.TGLImage.html#Create">Create</a></b>(const URL: string; const LoadAsClass: array of <a  href="CastleImages.html#TEncodedImageClass">TEncodedImageClass</a>; const ResizeToX: Cardinal = 0; const ResizeToY: Cardinal = 0; const Interpolation: <a  href="CastleImages.html#TResizeInterpolation">TResizeInterpolation</a> = riNearest);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <b><a  href="CastleGLImages.TGLImage.html#Create">Create</a></b>(const URL: string; const LoadAsClass: array of <a  href="CastleImages.html#TEncodedImageClass">TEncodedImageClass</a>; const AScalingPossible: boolean);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>destructor <b><a  href="CastleGLImages.TGLImage.html#Destroy">Destroy</a></b>; override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleGLImages.TGLImage.html#Rect">Rect</a></b>: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw">Draw</a></b>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw">Draw</a></b>(const X, Y: Integer);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw">Draw</a></b>(const Pos: <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw">Draw</a></b>(const X, Y, DrawWidth, DrawHeight: Integer; const ImageX, ImageY, ImageWidth, ImageHeight: Single);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw">Draw</a></b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw">Draw</a></b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const ImageX, ImageY, ImageWidth, ImageHeight: Single);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw">Draw</a></b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const ImageRect: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw3x3">Draw3x3</a></b>(const X, Y, DrawWidth, DrawHeight: Integer; const CornerTop, CornerRight, CornerBottom, CornerLeft: Integer);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw3x3">Draw3x3</a></b>(const X, Y, DrawWidth, DrawHeight: Integer; const Corner: <a  href="CastleVectors.html#TVector4Integer">TVector4Integer</a>);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw3x3">Draw3x3</a></b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Corner: <a  href="CastleVectors.html#TVector4Integer">TVector4Integer</a>);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw3x1">Draw3x1</a></b>(const X, Y, DrawWidth, DrawHeight: Integer; const SideRight, SideLeft: Integer);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw3x1">Draw3x1</a></b>(const X, Y, DrawWidth, DrawHeight: Integer; const Side: <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Draw3x1">Draw3x1</a></b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Side: <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleGLImages.TGLImage.html#Load">Load</a></b>(const Image: <a  href="CastleImages.TEncodedImage.html">TEncodedImage</a>);</code></td>
</tr>
</table>
<a name="PasDoc-Properties"></a><h3 class="summary">Properties</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleGLImages.TGLImage.html#Width">Width</a></b>: Cardinal read FWidth;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleGLImages.TGLImage.html#Height">Height</a></b>: Cardinal read FHeight;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleGLImages.TGLImage.html#Alpha">Alpha</a></b>: <a  href="CastleImages.html#TAlphaChannel">TAlphaChannel</a> read FAlpha write FAlpha;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleGLImages.TGLImage.html#IgnoreTooLargeCorners">IgnoreTooLargeCorners</a></b>: boolean
      read FIgnoreTooLargeCorners write FIgnoreTooLargeCorners default false;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleGLImages.TGLImage.html#Color">Color</a></b>: <a  href="CastleColors.html#TCastleColor">TCastleColor</a> read FColor write FColor;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleGLImages.TGLImage.html#ScalingPossible">ScalingPossible</a></b>: boolean read FScalingPossible write SetScalingPossible;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Create"></a><code>constructor <b>Create</b>(const Image: <a  href="CastleImages.TEncodedImage.html">TEncodedImage</a>; const AScalingPossible: boolean = false);</code></td>
</tr>
<tr><td colspan="2">
<p>
Prepare image for drawing.

<p></p>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleGLImages.EImageClassNotSupportedForOpenGL.html">EImageClassNotSupportedForOpenGL</a></dt>
<dd>When Image class is not supported by OpenGL.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Create"></a><code>constructor <b>Create</b>(const URL: string; const AScalingPossible: boolean = false);</code></td>
</tr>
<tr><td colspan="2">
<p>
Load image from disk, and prepare for drawing.

<p>

<p>

<p>

<p>

<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>LoadAsClass</dt>
<dd>Force a specific image class to load. Must be a subset of <a class="normal" href="CastleGLImages.html#PixelsImageClasses">PixelsImageClasses</a>, as other classes cannot be loaded into OpenGL 2D images, otherwise you may get <a class="normal" href="CastleGLImages.EImageClassNotSupportedForOpenGL.html">EImageClassNotSupportedForOpenGL</a> exception. Pass empty set [] to load into any allowed class (it's equivalent to passing LoadAsClass = <a class="normal" href="CastleGLImages.html#PixelsImageClasses">PixelsImageClasses</a>).

<p>You can pass e.g. [<a class="normal" href="CastleImages.TRGBImage.html">TRGBImage</a>] to force loading into an RGB image without an <a class="normal" href="CastleGLImages.TGLImage.html#Alpha">alpha</a> channel (it will be stripped from the image if necessary).</dd>
<dt>ResizeToX</dt>
<dd>After loading, resize to given width. Pass 0 to not resize width.</dd>
<dt>ResizeToY</dt>
<dd>After loading, resize to given height. Pass 0 to not resize height.</dd>
<dt>Interpolation</dt>
<dd>If any resizing will be needed (if ResizeToX / ResizeToY parameters request some specific size, and it is different than loaded image size) then the resize operation will use given interpolation.</dd>
</dl>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleGLImages.EImageClassNotSupportedForOpenGL.html">EImageClassNotSupportedForOpenGL</a></dt>
<dd>When image class is not supported by OpenGL.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Create"></a><code>constructor <b>Create</b>(const URL: string; const LoadAsClass: array of <a  href="CastleImages.html#TEncodedImageClass">TEncodedImageClass</a>; const ResizeToX: Cardinal = 0; const ResizeToY: Cardinal = 0; const Interpolation: <a  href="CastleImages.html#TResizeInterpolation">TResizeInterpolation</a> = riNearest);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Create"></a><code>constructor <b>Create</b>(const URL: string; const LoadAsClass: array of <a  href="CastleImages.html#TEncodedImageClass">TEncodedImageClass</a>; const AScalingPossible: boolean);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Destroy"></a><code>destructor <b>Destroy</b>; override;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Rect"></a><code>function <b>Rect</b>: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Rectangle representing the inside of this image. Always (Left,Bottom) are zero, and (Width,Height) correspond to image sizes.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw"></a><code>procedure <b>Draw</b>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Draw the image as 2D on screen.

<p>The X, Y parameters determine where the left-bottom corner of the image will be placed (from 0 to size - 1). The overloaded version without X, Y parameters uses current <a class="normal" href="CastleGLUtils.html#WindowPos">WindowPos</a>.

<p>You should only use this inside <a class="normal" href="CastleUIControls.TUIControl.html#Render">TUIControl.Render</a> when <a class="normal" href="CastleUIControls.TUIControl.html#RenderStyle">TUIControl.RenderStyle</a> returns rs2D. This means that we require that current projection is 2D and lighting / depth test and such are off.

<p>The image is drawn in 2D. In normal circumstances 1 pixel of the image is just placed over 1 pixel of the screen, and we draw the whole image. You can also use the overloaded version with 8 parameters where you explicitly specify the DrawWidth and DrawHeight of the rectangle on the screen, and explicitly choose the portion of the image to draw. If you want to draw scaled image (that is, use ImageWidth different than DrawWidth or ImageHeight different than DrawHeight) be sure to construct an image with <a class="normal" href="CastleGLImages.TGLImage.html#ScalingPossible">ScalingPossible</a> = <code>True</code> (otherwise runtime scaling may look ugly).

<p>Note that the image position (ImageX, ImageY) is specified like a texture coordinate. So (0, 0) is actually the left-bottom corner of the left-bottom pixel, and (Width,Height) is the right-top corner of the right-top pixel. That is why image position and sizes are floats, it makes sense to render partial pixels this way (make sure you have <a class="normal" href="CastleGLImages.TGLImage.html#ScalingPossible">ScalingPossible</a> = <code>True</code> to get nice scaling of image contents). You can also flip the image horizontally or vertically, e.g. use ImageX = Width and ImageWidth = -Width to mirror image horizontally.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw"></a><code>procedure <b>Draw</b>(const X, Y: Integer);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw"></a><code>procedure <b>Draw</b>(const Pos: <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw"></a><code>procedure <b>Draw</b>(const X, Y, DrawWidth, DrawHeight: Integer; const ImageX, ImageY, ImageWidth, ImageHeight: Single);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw"></a><code>procedure <b>Draw</b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw"></a><code>procedure <b>Draw</b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const ImageX, ImageY, ImageWidth, ImageHeight: Single);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw"></a><code>procedure <b>Draw</b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const ImageRect: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw3x3"></a><code>procedure <b>Draw3x3</b>(const X, Y, DrawWidth, DrawHeight: Integer; const CornerTop, CornerRight, CornerBottom, CornerLeft: Integer);</code></td>
</tr>
<tr><td colspan="2">
<p>
Draw the image on the screen, divided into 3x3 parts for corners, sides, and inside.

<p>Just like the regular <a class="normal" href="CastleGLImages.TGLImage.html#Draw">Draw</a> 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:

<p></p>

<ul class="paragraph_spacing">
  <li><p>4 corners, used to fill the corners of the screen rectangle. They are not stretched.</p></li>
  <li><p>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.</p></li>
  <li><p>the inside. Used to fill the rectangular inside. Scaled in both dimensions as necessary.</p></li>
</ul>

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw3x3"></a><code>procedure <b>Draw3x3</b>(const X, Y, DrawWidth, DrawHeight: Integer; const Corner: <a  href="CastleVectors.html#TVector4Integer">TVector4Integer</a>);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw3x3"></a><code>procedure <b>Draw3x3</b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Corner: <a  href="CastleVectors.html#TVector4Integer">TVector4Integer</a>);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw3x1"></a><code>procedure <b>Draw3x1</b>(const X, Y, DrawWidth, DrawHeight: Integer; const SideRight, SideLeft: Integer);</code></td>
</tr>
<tr><td colspan="2">
<p>
Draw the image on the screen, divided into 3x1 parts: unscaled left and right sides, and scaled inside.

<p>Similar to <a class="normal" href="CastleGLImages.TGLImage.html#Draw3x3">Draw3x3</a>, but image is divided into 3 parts, not 9.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw3x1"></a><code>procedure <b>Draw3x1</b>(const X, Y, DrawWidth, DrawHeight: Integer; const Side: <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Draw3x1"></a><code>procedure <b>Draw3x1</b>(const ScreenRectangle: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Side: <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>);</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Load"></a><code>procedure <b>Load</b>(const Image: <a  href="CastleImages.TEncodedImage.html">TEncodedImage</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Load the given image contents. Use this to efficiently replace the <a class="normal" href="CastleGLImages.TGLImage.html">TGLImage</a> contents on GPU. Updates the <a class="normal" href="CastleGLImages.TGLImage.html#Width">Width</a>, <a class="normal" href="CastleGLImages.TGLImage.html#Height">Height</a>, <a class="normal" href="CastleGLImages.TGLImage.html#Alpha">Alpha</a> to correspond to new image.</p>
</td></tr>
</table>
<h3 class="detail">Properties</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Width"></a><code>property <b>Width</b>: Cardinal read FWidth;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Height"></a><code>property <b>Height</b>: Cardinal read FHeight;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Alpha"></a><code>property <b>Alpha</b>: <a  href="CastleImages.html#TAlphaChannel">TAlphaChannel</a> read FAlpha write FAlpha;</code></td>
</tr>
<tr><td colspan="2">
<p>
How to treat <code>alpha</code> channel of the texture.

<p></p>

<ul class="paragraph_spacing">
  <li><p>acNone means to ignore it.</p></li>
  <li><p>acSimpleYesNo means to render with <code>alpha</code>-test.</p></li>
  <li><p>acFullRange means to render with blending.</p></li>
</ul>

<p>

<p>This is initialized based on loaded image class and data. This means that e.g. if you have smooth <code>alpha</code> channel in the image, it will be automatically rendered with nice blending.

<p>You can change the value of this property to force a specific rendering method, for example to force using <code>alpha</code> test or <code>alpha</code> blending regardless of <code>alpha</code> values. Or to disable <code>alpha</code> channel usage, because your image must always cover pixels underneath.

<p>Remember that you can also change the <code>alpha</code> channel existence at loading: use LoadAsClass parameters of <a class="normal" href="CastleImages.html#LoadImage">LoadImage</a> or <a class="normal" href="CastleGLImages.TGLImage.html#Create">TGLImage.Create</a> to force your image to have/don't have an <code>alpha</code> channel (e.g. use LoadAsClass=[<a class="normal" href="CastleImages.TRGBImage.html">TRGBImage</a>] to force RGB image without <code>alpha</code>, use LoadAsClass=[<a class="normal" href="CastleImages.TRGBAlphaImage.html">TRGBAlphaImage</a>] to force <code>alpha</code> channel).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IgnoreTooLargeCorners"></a><code>property <b>IgnoreTooLargeCorners</b>: boolean
      read FIgnoreTooLargeCorners write FIgnoreTooLargeCorners default false;</code></td>
</tr>
<tr><td colspan="2">
<p>
Ignore (do not log to <a class="normal" href="CastleLog.html">CastleLog</a>) situations when <a class="normal" href="CastleGLImages.TGLImage.html#Draw3x3">Draw3x3</a> or <a class="normal" href="CastleGLImages.TGLImage.html#Draw3x1">Draw3x1</a> cannot work because corners are larger than draw area size. Set this to <code>True</code> when it's perfectly possible (you do not want to even see it in log) for <a class="normal" href="CastleGLImages.TGLImage.html#Draw3x3">Draw3x3</a> and <a class="normal" href="CastleGLImages.TGLImage.html#Draw3x1">Draw3x1</a> calls to fail because corners are larger than draw area size.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Color"></a><code>property <b>Color</b>: <a  href="CastleColors.html#TCastleColor">TCastleColor</a> read FColor write FColor;</code></td>
</tr>
<tr><td colspan="2">
<p>
Color to multiply the texture contents (all RGBA channels). By default this is <a class="normal" href="CastleColors.html#White">White</a>, which is (1, 1, 1, 1) as RGBA, and it means that texture contents are not actually modified. This case is also optimized when possible, to no multiplication will actually happen.

<p>Note that the <a class="normal" href="CastleGLImages.TGLImage.html#Alpha">alpha</a> of this color does not determine our <a class="normal" href="CastleGLImages.TGLImage.html#Alpha">alpha</a> rendering mode (it cannot, as you can change this color at any point, and after creation the <a class="normal" href="CastleGLImages.TGLImage.html#Alpha">Alpha</a> is never automatically updated). If you set a color with <a class="normal" href="CastleGLImages.TGLImage.html#Alpha">alpha</a> &lt;&gt; 1, consider setting also <a class="normal" href="CastleGLImages.TGLImage.html#Alpha">Alpha</a> property to whatever you need.

<p>Note that if use <a class="normal" href="CastleImages.TGrayscaleImage.html">TGrayscaleImage</a> with <a class="normal" href="CastleImages.TGrayscaleImage.html#TreatAsAlpha">TGrayscaleImage.TreatAsAlpha</a> (which means that texture does not contain any RGB information), then only this color's RGB values determine the drawn RGB color.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="ScalingPossible"></a><code>property <b>ScalingPossible</b>: boolean read FScalingPossible write SetScalingPossible;</code></td>
</tr>
<tr><td colspan="2">
<p>
Is the image filtering mode ready for scaling. &quot;Scaling&quot; here means drawing such that one image pixel does not perfectly cover one screen pixel. For example, using <a class="normal" href="CastleGLImages.TGLImage.html#Draw">Draw</a> to draw the whole image, but with the size of the image on screen different than image size. If you want to do such drawing, set <code>ScalingPossible</code> to <code>True</code>.

<p>On the other hand, if you will not ever do scaling, then leave <code>ScalingPossible</code> to <code>False</code>. It may cause minimally faster drawing, and avoids any possible artifacts from bilinear filtering.

<p>Note that switching this property after this object is constructed is possible, but costly.</p>
</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "1"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->

<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:10</em>
</span>
</td></tr></table></body></html>