Delphi’s holy source of knowledge!

  • How can I calculate collisions between 2 TModel3D in Delphi FMX

    To calculate collisions between two TModel3D components in Delphi FMX, you can use the intersection methods provided by the TModel3D class. Here’s an example of how you can use the IntersectsBox method to check for a collision between two models; if Model1.IntersectsBox(Model2) then begin //collision detected end; The IntersectsBox method returns True if the bounding…

  • How can I load 3D model and move it in Delphi FMX

    To load a 3D model and move it in Delphi FMX, you can use the TModel3D component and the TControl3D class. Here’s an example of how you can do this Drag a TModel3D component from the FireMonkey 3D Components palette onto your form. In the Model3D property of the TModel3D component, specify the path to…

  • How do I make TCP server-client communication in Delphi FMX

    To create a TCP server-client communication in Delphi FMX, you can use the TIdTCPServer and TIdTCPClient components from the IdTCPServer and IdTCPClient units. Here is an example of how you can use these components to create a simple TCP server and client in Delphi FMX; uses IdTCPServer, IdTCPClient; procedure TForm1.FormCreate(Sender TObject); var TCPServer TIdTCPServer; TCPClient…

  • How do I make UDP server-client communication in Delphi FMX

    To create a UDP server-client communication in Delphi FMX, you can use the TIdUDPClient and TIdUDPServer components from the IdUDPServer and IdUDPClient units. Here is an example of how you can use these components to create a simple UDP server and client in Delphi FMX; uses IdUDPServer, IdUDPClient; procedure TForm1.FormCreate(Sender TObject); var UDPServer TIdUDPServer; UDPClient…

  • How do I make a listview with an image, caption and subtext in Delphi

    To create a listview with an image, caption, and subtext in Delphi, you can use the TListView control and set its ViewStyle property to vsReport. Then, you can add items to the listview by creating TListItem objects and setting their properties. Here is some sample code that demonstrates how to create a listview with an…

  • How do I parse json in Delphi

    To parse JSON in Delphi, you can use the TJsonObject class from the System.JSON unit of the Delphi RTL. This class provides properties and methods that allow you to parse a JSON string and access the values of the JSON properties. Here is an example of how you can use the TJsonObject class in Delphi…

  • How do I off smart screen in Delphi

    To turn off the SmartScreen filter in Delphi, you can use the SetSmartScreenFilter function from the Winapi.ShellAPI unit of the Delphi RTL. This function allows you to enable or disable the SmartScreen filter for your Delphi application, so that it is not blocked by the security feature in Windows. Here is an example of how…

  • How do I make different ways to round number in Delphi

    In Delphi, you can use the following functions to round a number to the nearest integer: Round: This function rounds a number to the nearest integer. If the fractional part of the number is exactly 0.5, the function will round to the nearest even integer. For example, Round(3.5) returns 4, and Round(4.5) returns 4. Trunc:…

  • How do I make a listview with an image, caption and subtext in Delphi FMX

    To create a listview with an image, caption, and subtext in Delphi FMX, you can use the TListView control and set its ItemAppearance.ItemHeight property to a value larger than the default to make room for the subtext. Then, you can add items to the listview by creating TListViewItem objects and setting their properties. Here is…

  • How can I simulate KeyDown event in Delphi

    To simulate a KeyDown event in Delphi, you can use the KeyDown method of the TWinControl class. This method takes a key code as an argument and simulates pressing the key. Here is an example of how to use the KeyDown method to simulate pressing the “A” key: procedure TForm1.Button1Click(Sender: TObject); begin Form1.KeyDown(VK_A); end; This…