gb_positioning_2d_utils_coordinate_conversion_test

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

GBPositioning2DUtils Coordinate Conversion Test Tests screen-to-world coordinate conversion accuracy for tile center positioning

Source File: /addons/grid_building/test/positioning/coordinates/gb_positioning_2d_utils_coordinate_conversion_test.gd

Extends: GdUnitTestSuite

Properties

  • Property: runner: GdUnitSceneRunner
  • Property: test_environment: [CollisionTestEnvironment](./collision-test-environment/)
  • Property: viewport: Viewport
  • Property: camera: Camera2D
  • Property: tile_map: TileMapLayer

Public Methods

before

1
before() -> void

before_test

1
before_test() -> void

after_test

1
after_test() -> void

after

1
after() -> void

test_screen_to_world_conversion_accuracy

1
test_screen_to_world_conversion_accuracy() -> void

Test: convert_screen_to_world_position converts screen coordinates accurately Setup: Known camera position and viewport configuration Act: Convert specific screen coordinates to world coordinates Assert: Conversion matches expected world position within tolerance


test_camera_offset_conversion

1
test_camera_offset_conversion() -> void

Test: convert_screen_to_world_position handles camera offset correctly Setup: Position camera away from origin Act: Convert screen coordinates with offset camera Assert: World position accounts for camera offset


test_tile_center_positioning_accuracy

1
test_tile_center_positioning_accuracy() -> void

Test: screen coordinates convert to exact tile centers for grid alignment Setup: Test with known tile grid and screen positions Act: Convert screen positions and check tile center alignment Assert: Converted positions snap to tile centers, not edges


test_multiple_screen_positions_tile_alignment

1
test_multiple_screen_positions_tile_alignment() -> void

Test: multiple screen positions all convert to proper tile centers Setup: Test grid of screen positions across viewport Act: Convert each position and verify tile center alignment Assert: All positions properly align to tile centers



Grid Building v5.0.8 | Generated 24/05/2026