Quote Originally Posted by ajol View Post
My only problem right now is I can't find a good way to use sprites.
In my old code, the main game screen is split into a grid, where all squares are 24*24 pixels. And I have the pictures of everything that could appear on the screen, saved in a single large image.
Then, depending on what was supposed to be in a certain square, I simply used CopyRect to copy the appropriate(24*24) parts from a single large image I created.

However, I can't seem to find any way to copy a part of an image using PXL. There's a lot of different functions for deciding what(whole) image to use, and a lot of parameters to decide how to copy it, but I can't seem to find a way to simply use a small part of a large image.
Have I missed something, or do I have to save the graphics for every single thing in the game as a separate image?
So you were creating and using Atlas Image manually by yourself when using LCL. You don't need to do this in PXL.
That is al already being handled by TAtlasImages class. So when you are rendering certain image you can only specify its name and all the rest is being done by PXL.

And while it is still possible to copy part of the image (at least it was possible in PXL predecessors) I would not recommend you doing that because by doing so you will just end up by moving lots of data from Video Memory to System Memory and then back to Video Memory. And as you can guess this can affect the performance a lot.
You se in PXL all textures are stored in Video Memory directly so graphics card can render them much quicker. And while in PXL predecessors all textures were loaded in one big Image Atlas PXL allows you to load and unload multiple Image Atlases. This can then be even used for dynamic asset loading and unloading.