Привет,
Gigatron!
Если интересно, то некоторую функциональность можно немного "упростить" и в понимании и в передаче данных.
Например можно задавать цвет либо посредством структуры или посредством LongWord. В первом варианте мы создаём структуру и можно задать данные по умолчанию:
Google translate:
Hi,
Gigatron!
If you're interested, some functionality can be slightly simplified, both in terms of understanding and data transfer.
For example, you can set the color either through a structure or through LongWord. In the first option, we create a structure and can set default data:
type
myTColor = record
R, G, B, A: Single;
end;
var // or constant
whiteColor: myTColor = (1, 1, 1, 1);
blackColor: myTColor = (0, 0, 0, 0);
Во втором варианте мы из целого числа работаем только с байтами. В этом случае число LongWord - RRGGBBAA (или AARRGGBB).
Различные варианты можно увидеть в разных движках и графических редакторах. Для передачи данных в процедуру или функцию, такие вещи проще. Просто передаём структуру или число RRGGBBAA и используем их.
Возможно ещё проще создавать объекты и все данные хранить в объектах. А все функции и процедуры уже будут работать от самих объектов (в основном).
Это только информация к размышлению! Успехов!
Eng: In the second option, we work only with bytes from the integer. In this case, the LongWord number is RRGGBBAA (or AARRGGBB).
Different options can be seen in different engines and graphic editors. Passing data to a procedure or function is simpler. We simply pass the RRGGBBAA structure or number and use it.
It might be even easier to create objects and store all data in objects. And all functions and procedures will work from the objects themselves (mostly).
This is just food for thought! Good luck!
