Re-Sizing Tilemap at Run Time

0 favourites
  • 4 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Link to .capx file (required!):

    Capx

    Steps to reproduce:

    1. Add a tilemap object to the project.

    2. Create an instance of the tilemap in the layout.

    3. Add events to re-size tilemap.

    4. If making a tilemap instance larger, add events to set tiles that should now be visible/available. If making a tilemap instance smaller, add events to set the tiles that should no longer be visible/available.

    5. Preview the Capx

    Observed result:

    The visible/available tiles do not change at runtime. The debugger confirms the width and height of the instance changes, but the visible tiles suggests otherwise.

    When running the above capx, the top tilemap instance displays a 2nd row of tiles. The bottom tilemap instance does not display a cactus at tilemap position 0,2.

    Expected result:

    Resizing a tilemap instance at run time updates the displayed/available tiles according to the instance's new size, similar to how the tilemap instance behaves in the editor.

    When running the above capx, the top tilemap should only display a single row of tiles since the instance's height was reduced to the height of a single tile. The bottom tilemap should display a cactus at tilemap position 0,2) since the instance's height was increased to 4x the height of a single tile.

    Browsers affected:

    Firefox: yes

    iOS: yes

    Operating system & service pack:

    Windows 7 64 bit SP1

    iOS 7.0.4

    Construct 2 version:

    r156

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, good catch - should be fixed in the next build.

  • Ashley

    I tested the above capx with r157. It looks like the appropriate tiles are available when making the tilemap larger, but when making the tilemap smaller, tiles that fall outside the object's dimensions are still displayed. When the above Capx is run, I would expect the top tilemap instance to only display 1 row of tiles.

    Is this intended behavior for the tilemap object?

  • Oops, you're right, should have that fixed in the next build too.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)