Тёмный

GLEngine2d / Polygons / Text / Fonts / Free Game Engine / Embarcadero Delphi 2022 / Delphi 7 

Sokovito Games
Подписаться 2,5 тыс.
Просмотров 188
50% 1

Download: github.com/Dev...
RU-vid: / @sokovito
Discord: / discord
Icq: 620163142
VK: sokolov...
Telegram: t.me/Sokovito
Facebook: / 664468363641045
Odnoklassniki: ok.ru/group/54...
LinkedIn: / sokovito
LinkedIn Group: / 9126028
Поддержать канал (Donate):
new.donatepay....
www.donationale...
Либо через криптовалюты:
BitCoin: bc1qvhrlwzv2jn7lnuf8kqxudq3lfnpm7rsujxsr7y
Bitcoin Cash: qzmac7evwlsyhfgy8s47slar3qwz5l2ug56xpq9p2p
Ethereum: 0x0e9876F515a6af061C9D1A38dAf98872e4158469
Ethereum Classic: 0x6293BCbf33FAf4Beb1E771D0a02138051D9F7C27
LiteCoint: ltc1qcay7ttpzuecvaez58a2zdecnu45plhn5p629td
Dogecoin: DFrmw65GuNkNcirzRVPY6szytDtpQFHaqk
Dash: Xiwyco9sWHgrXwN6nt7cXw6LjArpQpkYKb
TRON: TXwPkiWHBKk6g9DMnCAuU7MhZ17yATKYL1
Solana: DpefmhbrD5wfmdqY5FfdY1zDzZELfCcaA37aAng8QAk4
NEAR: 078ffccc338eb31ba1f7c26afc60a8f28c2034010424f7d5319c81ec5cf6bdf9
!!! Перевод можно сделать как со своего крипто кошелька, так и через обменные системы с обычных банковских карт или других платежных систем:
www.bestchange...
First, let's comment out the drawing of graphic primitives from previous videos so that they do not interfere with us.
To work with a polygon (polygon), we declare an array of points. In our case, there will be a decagon, which means we declare ten points (from zero to nine in the array). The array type is TGLPoint. Then you need to set the coordinates of each point. After that, the Polygon method is called. The X,Y coordinates are given in parentheses. These are the coordinates of the additional shift relative to the original coordinates of each point. Each point of the polygon will be shifted by the specified shift values ​​(that is, they are added to the points' original coordinates). This is useful if you need to move the figure to new coordinates without changing the coordinates of each point separately. Then we specify the rotation angles (AngleRotate and TESAngleRotate). At the end, the name of the array of points is passed, according to which the figure will be built.
To output text, the TextOut method is present. The x,y coordinates for text output are indicated in brackets, then the necessary text is written in single quotes or a variable is passed that stores the text of the String type. But it must first be declared in the Var section.
The SetTextStyle method is used to change the font of the displayed text. The parentheses indicate the name of the font and its size.
It is also possible to use your own fonts in the form of pictures.
First, a global variable of type Cardinal is declared. It cannot be declared local, since we will work with it in different procedures or functions. Then, using the LoadImage method, an image in BMP, JPG, TGA or PNG format is loaded into it. The path to the image is given in parentheses. Due to the ExtractFileDir or ExtractFilePath command, we get the path to the folder in which the launch file of our application is located, and then add an additional path (if required) and the file name, taking into account its extension. When working in Embarcadero Delphi, put the images in the correct folder with the launch file, depending on which platform you are compiling for and what type of Debug or Release. Next, a variable is specified into which the image of the Cardinal format is loaded. At the end, we indicate whether the image should be loaded from the resource. If necessary, write True, if not, write False.
To display a font as an image, use the TextOutUseImageFont method. The X,Y coordinates for display on the screen are indicated in brackets, then the text itself is written in single quotes. If you need to write text not in one line, but in several - then you need to add a line break character # 13, which is added with a plus sign between different lines. Next is the name of the variable that stores the font. Then the text rotation angle is specified from 0 to 360. At the end, the width and height of the letters are specified.
If instead of displaying characters only a colored background is displayed, you can try either to remove the second instance of the engine (if you have created one), or set its initialization before the instance of the engine on which you are working with text.
That's all for me. If this video was useful or interesting for you, put your finger up and write a comment, as well as subscribe to the channel to be aware of the release of new videos. In the description under the video there are details for financial support of the channel. Your help is very important! Vitaly Sokolov was with you. See you in the next videos!

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии