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
| ///Предоставляет базовые процедуры и функции для работы с графикой в игровом движке.
unit BaseGraphicsSystem;
uses GraphABC;
const
//Цветовые константы
clAquamarine = Color.Aquamarine; clAzure = Color.Azure;
clBeige = Color.Beige; clBisque = Color.Bisque;
clBlack = Color.Black; clBlanchedAlmond = Color.BlanchedAlmond;
clBlue = Color.Blue; clBlueViolet = Color.BlueViolet;
clBrown = Color.Brown; clBurlyWood = Color.BurlyWood;
clCadetBlue = Color.CadetBlue; clChartreuse = Color.Chartreuse;
clChocolate = Color.Chocolate; clCoral = Color.Coral;
clCornflowerBlue = Color.CornflowerBlue; clCornsilk = Color.Cornsilk;
clCrimson = Color.Crimson; clCyan = Color.Cyan;
clDarkBlue = Color.DarkBlue; clDarkCyan = Color.DarkCyan;
clDarkGoldenrod = Color.DarkGoldenrod; clDarkGray = Color.DarkGray;
clDarkGreen = Color.DarkGreen; clDarkKhaki = Color.DarkKhaki;
clDarkMagenta = Color.DarkMagenta; clDarkOliveGreen = Color.DarkOliveGreen;
clDarkOrange = Color.DarkOrange; clDarkOrchid = Color.DarkOrchid;
clDarkRed = Color.DarkRed; clDarkTurquoise = Color.DarkTurquoise;
clDarkSeaGreen = Color.DarkSeaGreen; clDarkSlateBlue = Color.DarkSlateBlue;
clDarkSlateGray = Color.DarkSlateGray; clDarkViolet = Color.DarkViolet;
clDeepPink = Color.DeepPink; clDarkSalmon = Color.DarkSalmon;
clDeepSkyBlue = Color.DeepSkyBlue; clDimGray = Color.DimGray;
clDodgerBlue = Color.DodgerBlue; clFirebrick = Color.Firebrick;
clFloralWhite = Color.FloralWhite; clForestGreen = Color.ForestGreen;
clFuchsia = Color.Fuchsia; clGainsboro = Color.Gainsboro;
clGhostWhite = Color.GhostWhite; clGold = Color.Gold;
clGoldenrod = Color.Goldenrod; clGray = Color.Gray;
clGreen = Color.Green; clGreenYellow = Color.GreenYellow;
clHoneydew = Color.Honeydew; clHotPink = Color.HotPink;
clIndianRed = Color.IndianRed; clIndigo = Color.Indigo;
clIvory = Color.Ivory; clKhaki = Color.Khaki;
clLavender = Color.Lavender; clLavenderBlush = Color.LavenderBlush;
clLawnGreen = Color.LawnGreen; clLemonChiffon = Color.LemonChiffon;
clLightBlue = Color.LightBlue; clLightCoral = Color.LightCoral;
clLightCyan = Color.LightCyan; clLightGray = Color.LightGray;
clLightGreen = Color.LightGreen; clLightGoldenrodYellow = Color.LightGoldenrodYellow;
clLightPink = Color.LightPink; clLightSalmon = Color.LightSalmon;
clLightSeaGreen = Color.LightSeaGreen; clLightSkyBlue = Color.LightSkyBlue;
clLightSlateGray = Color.LightSlateGray; clLightSteelBlue = Color.LightSteelBlue;
clLightYellow = Color.LightYellow; clLime = Color.Lime;
clLimeGreen = Color.LimeGreen; clLinen = Color.Linen;
clMagenta = Color.Magenta; clMaroon = Color.Maroon;
clMediumBlue = Color.MediumBlue; clMediumOrchid = Color.MediumOrchid;
clMediumAquamarine = Color.MediumAquamarine; clMediumPurple = Color.MediumPurple;
clMediumSeaGreen = Color.MediumSeaGreen; clMediumSlateBlue = Color.MediumSlateBlue;
clPlum = Color.Plum; clMistyRose = Color.MistyRose;
clNavy = Color.Navy; clMidnightBlue = Color.MidnightBlue;
clMintCream = Color.MintCream; clMediumSpringGreen = Color.MediumSpringGreen;
clMoccasin = Color.Moccasin; clNavajoWhite = Color.NavajoWhite;
clMediumTurquoise = Color.MediumTurquoise; clOldLace = Color.OldLace;
clOlive = Color.Olive; clOliveDrab = Color.OliveDrab;
clOrange = Color.Orange; clOrangeRed = Color.OrangeRed;
clOrchid = Color.Orchid; clPaleGoldenrod = Color.PaleGoldenrod;
clPaleGreen = Color.PaleGreen; clPaleTurquoise = Color.PaleTurquoise;
clPaleVioletRed = Color.PaleVioletRed; clPapayaWhip = Color.PapayaWhip;
clPeachPuff = Color.PeachPuff; clPeru = Color.Peru;
clPink = Color.Pink; clMediumVioletRed = Color.MediumVioletRed;
clPowderBlue = Color.PowderBlue; clPurple = Color.Purple;
clRed = Color.Red; clRosyBrown = Color.RosyBrown;
clRoyalBlue = Color.RoyalBlue; clSaddleBrown = Color.SaddleBrown;
clSalmon = Color.Salmon; clSandyBrown = Color.SandyBrown;
clSeaGreen = Color.SeaGreen; clSeaShell = Color.SeaShell;
clSienna = Color.Sienna; clSilver = Color.Silver;
clSkyBlue = Color.SkyBlue; clSlateBlue = Color.SlateBlue;
clSlateGray = Color.SlateGray; clSnow = Color.Snow;
clSpringGreen = Color.SpringGreen; clSteelBlue = Color.SteelBlue;
clTan = Color.Tan; clTeal = Color.Teal;
clThistle = Color.Thistle; clTomato = Color.Tomato;
clTransparent = Color.Transparent; clTurquoise = Color.Turquoise;
clViolet = Color.Violet; clWheat = Color.Wheat;
clWhite = Color.White; clWhiteSmoke = Color.WhiteSmoke;
clYellow = Color.Yellow; clYellowGreen = Color.YellowGreen;
//Коды клавиш
VK_Back = 8; VK_Tab = 9;
VK_LineFeed = 10; VK_Enter = 13;
VK_Return = 13; VK_ShiftKey = 16; VK_ControlKey = 17;
VK_Menu = 18; VK_Pause = 19; VK_CapsLock = 20;
VK_Capital = 20;
VK_Escape = 27;
VK_Space = 32;
VK_Prior = 33; VK_PageUp = 33; VK_PageDown = 34;
VK_Next = 34; VK_End = 35; VK_Home = 36;
VK_Left = 37; VK_Up = 38; VK_Right = 39;
VK_Down = 40; VK_Select = 41; VK_Print = 42;
VK_Snapshot = 44; VK_PrintScreen = 44;
VK_Insert = 45; VK_Delete = 46; VK_Help = 47;
VK_A = 65; VK_B = 66;
VK_C = 67; VK_D = 68; VK_E = 69;
VK_F = 70; VK_G = 71; VK_H = 72;
VK_I = 73; VK_J = 74; VK_K = 75;
VK_L = 76; VK_M = 77; VK_N = 78;
VK_O = 79; VK_P = 80; VK_Q = 81;
VK_R = 82; VK_S = 83; VK_T = 84;
VK_U = 85; VK_V = 86; VK_W = 87;
VK_X = 88; VK_Y = 89; VK_Z = 90;
VK_LWin = 91; VK_RWin = 92; VK_Apps = 93;
VK_Sleep = 95; VK_NumPad0 = 96; VK_NumPad1 = 97;
VK_NumPad2 = 98; VK_NumPad3 = 99; VK_NumPad4 = 100;
VK_NumPad5 = 101; VK_NumPad6 = 102; VK_NumPad7 = 103;
VK_NumPad8 = 104; VK_NumPad9 = 105; VK_Multiply = 106;
VK_Add = 107; VK_Separator = 108; VK_Subtract = 109;
VK_Decimal = 110; VK_Divide = 111; VK_F1 = 112;
VK_F2 = 113; VK_F3 = 114; VK_F4 = 115;
VK_F5 = 116; VK_F6 = 117; VK_F7 = 118;
VK_F8 = 119; VK_F9 = 120; VK_F10 = 121;
VK_F11 = 122; VK_F12 = 123; VK_NumLock = 144;
VK_Scroll = 145; VK_LShiftKey = 160; VK_RShiftKey = 161;
VK_LControlKey = 162; VK_RControlKey = 163; VK_LMenu = 164;
VK_RMenu = 165;
VK_KeyCode = 65535; VK_Shift = 65536; VK_Control = 131072;
VK_Alt = 262144; VK_Modifiers = -65536;
type
///Тип цвета.
TColor = Color;
///Тип точки.
TPoint = Point;
///Тип рисунка.
TPicture = Picture;
///Тип массива точек.
TPointArray = array of TPoint;
///Тип пера
TPen = GraphABCPen;
///Тип кисти
TBrush = GraphABCBrush;
///Тип кисти
TFont = GraphABCFont;
///Стили кисти.
TBrushStyleType = BrushStyleType;
///Тип штриховки кисти.
THatchStyle = HatchStyle;
///Возвращает текущее перо.
function GetPen() := Pen();
///Возвращает текущую кисть.
function GetBrush() := Brush();
///Центрирует окно.
procedure SetCenterOnScreen() := Window.CenterOnScreen();
///Получает центр окна.
procedure GetWindowCenter() := WindowCenter();
///Устанавливает заголовок окна.
procedure SetWindowCaption(obj: object) := SetWindowCaption(obj.ToString());
///Получает заголовок окна.
procedure GetWindowCaption() := WindowCaption();
///Устанавливает смещение окна.
procedure SetWindowPosition(p: TPoint) := SetWindowPos(p.X, p.Y);
///Получает смещение окна.
procedure GetWindowPosition(p: TPoint) := new TPoint(WindowLeft(), WindowTop());
///Максимизирует графическое окно.
procedure Maximize() := Window.Maximize();
///Миниммизирует графическое окно.
procedure Minimize() := Window.Minimize();
//---------------------------------------------------------------------------
procedure SetPixel(x, y: real; c: TColor) := SetPixel(Round(x), Round(y), c);
procedure PutPixel(x, y: real; c: TColor) := SetPixel(x, y, c);
function GetPixel(x, y: real): TColor := GetPixel(Round(x), Round(y));
//---------------------------------------------------------------------------
procedure MoveTo(x, y: real) := MoveTo(Round(x), Round(y));
procedure LineTo(x,y: real) := LineTo(Round(x), Round(y));
procedure LineTo(x, y: real; c: TColor) := LineTo(Round(x), Round(y), c);
//---------------------------------------------------------------------------
procedure Line(x1, y1, x2, y2: real) := Line(Round(x1), Round(y1), Round(x2), Round(y2));
procedure Line(x1, y1, x2, y2: real; c: TColor) := Line(Round(x1), Round(y1), Round(x2), Round(y2), c);
procedure FillCircle(x, y, r: real) := FillCircle(Round(x), Round(y), Round(r));
procedure DrawCircle(x, y, r: real) := FillCircle(Round(x), Round(y), Round(r));
procedure FillEllipse(x1, y1, x2, y2: real) := FillEllipse(Round(x1), Round(y1), Round(x2), Round(y2));
procedure DrawEllipse(x1, y1, x2, y2: real) := DrawEllipse(Round(x1), Round(y1), Round(x2), Round(y2));
procedure FillRectangle(x1, y1, x2, y2: real) := FillRectangle(Round(x1), Round(y1), Round(x2), Round(y2));
procedure DrawRectangle(x1, y1, x2, y2: real) := DrawRectangle(Round(x1), Round(y1), Round(x2), Round(y2));
procedure FillRoundRect(x1, y1, x2, y2, w, h: real) := FillRoundRect(Round(x1), Round(y1), Round(x2), Round(y2), Round(w), Round(h));
procedure DrawRoundRect(x1, y1, x2, y2, w, h: real) := DrawRoundRect(Round(x1), Round(y1), Round(x2), Round(y2), Round(w), Round(h));
procedure Arc(x, y, r, a1, a2: real) := Arc(Round(x), Round(y), Round(r), Round(a1), Round(a2));
procedure FillPie(x, y, r, a1, a2: real) := FillPie(Round(x), Round(y), Round(r), Round(a1), Round(a2));
procedure DrawPie(x, y, r, a1, a2: real) := DrawPie(Round(x), Round(y), Round(r), Round(a1), Round(a2));
procedure Pie(x, y, r, a1, a2: real) := Pie(Round(x), Round(y), Round(r), Round(a1), Round(a2));
procedure TextOut<T>(x, y: real; obj: object) := TextOut(Round(x), Round(y), obj.ToString());
procedure DrawTextCentered<T>(x1, y1, x2, y2: real; obj: T) := DrawTextCentered(Round(x1), Round(y1), Round(x2), Round(y2), obj.ToString());
procedure FloodFill(x, y: real; c: TColor) := FloodFill(Round(x), Round(y), c);
//---------------------------------------------------------------------------
procedure Circle(x, y, r: real) := Circle(Round(x), Round(y), Round(r));
procedure Ellipse(x1, y1, x2, y2: real) := Ellipse(Round(x1), Round(y1), Round(x2), Round(y2));
procedure Rectangle(x1, y1, x2, y2: real) := Rectangle(Round(x1), Round(y1), Round(x2), Round(y2));
procedure RoundRectangle(x1, y1, x2, y2, w, h: real) := RoundRect(Round(x1), Round(y1), Round(x2), Round(y2), Round(w), Round(h));
end. |