Hello community!
I’m creating a 2D room generation system in GDevelop where the layout is defined by a “blueprint” image (e.g., 11x11 pixels), with colors representing different tiles (wall, floor, etc.).
My goal is to:
- Load the “blueprint” image into a Sprite object (
RoomBlueprint
). - Iterate through each pixel of the blueprint.
- Read the RGB color of each pixel using the “Read pixels” extension.
- Based on the color, create the corresponding tile (e.g.,
WallTile
,FloorTile
) at the correct coordinates.
My main question is: Can the “Read pixels” extension be used to implement this room generation system as I described? If so, what is the correct and complete syntax for reading the RGB (Red, Green, Blue) values of a specific pixel from a Sprite object using this extension?
Any help or event examples would be greatly appreciated!
Thank you!