Archived

This topic is now archived and is closed to further replies.

planewalker

DelphiX-Problem: Accessing Pixels of a TDXImageList Item

Recommended Posts

In my little game (oh wonder - tile based), i''d like a small map thats showing a larger part of the game world than the main window. To do that, I created a TDXImageList - Bitmap and tried to set the pixels according to the tiles of my map, but there doesn''t seem to be a method available to do that... Please help! See Ya, planewalker

Share this post


Link to post
Share on other sites
Try this...


DXImageList.Items[item].PatternSurfaces[pattern].Pixels[x,y] := pixeldata;


This is nice for 256 color modes where the colors are pre-set. You may also need to "ColorMatch" your colors first...


pixeldata := ImageList.Items[0].PatternSurfaces[0].ColorMatch(color); // where color is a TColor





[ Michael Wilson | turbo sys-op | turbo.gamedev.net ]

Share this post


Link to post
Share on other sites
With a static map, you should only have to read the 150x150 map once, and then display it. If you need real-time updating I would suggest using a TDIB and then Assign()Iing it to a Surface that then get''s BLTed to the screen...



[ Michael Wilson | turbo sys-op | turbo.gamedev.net ]

Share this post


Link to post
Share on other sites