Add rectangles_intersect usage example - #797
Conversation
❌ Deploy Preview for splashkit failed.
|
AAMIRAU
left a comment
There was a problem hiding this comment.
Hi Rachel, the example is clear and the implementations are consistent across C++, C# top-level and C# OOP. The GIF also demonstrates the intersection behaviour well. Before approval, could you please verify the Python colour and text-drawing API calls, and confirm whether the generated usage-example-references.json file should be excluded from the PR?
|
@AAMIRAU Thanks for reviewing the example! I've double-checked the Python implementation and confirmed that the colour constants and draw_text call are correct and consistent with the equivalent C++, C# top-level, and C# OOP examples. I also confirmed that usage-example-references.json is required, as it registers the new usage example so it appears in the documentation, so I've kept that in the PR. Thanks again for the feedback! |
|
sorry for the delay |
ralphweng2023
left a comment
There was a problem hiding this comment.
Picking up the two things AAMIRAU raised on the 30th, since both are still live.
The Python file cannot run as committed. COLOR_WHITE and the other four colours are C++ defines, Python spells them color_white() and so on, so line 24 raises before anything is drawn. fill_rectangle is passed two arguments where the Python binding wants five, the two argument form is fill_rectangle_record, and draw_text is passed four where it wants six, which is draw_text_no_font_no_size.
The telling part is the references JSON. It lists color_white and draw_text_no_font_no_size among the functions used, and the committed .py calls neither, so that file was generated from a working version which did not make it into the commit. Please commit that version instead, and drop the JSON since the scraper rebuilds it.
| movable_rectangle | ||
| ) | ||
|
|
||
| clear_screen(COLOR_WHITE) |
There was a problem hiding this comment.
Same swap applies to the other four colours.
| clear_screen(COLOR_WHITE) | |
| clear_screen(color_white()) |
Description
Splashkit Function:
rectangles_intersectOverview of example functionality: Demonstrates how to use
rectangles_intersectto detect whether two rectangles overlap. One rectangle remains fixed while the other follows the mouse cursor, changing the rectangle colours and displayed message when an intersection occurs.Example Output: rectangles_intersect-1-example.gif showing the rectangles changing colour when they intersect.
Files Included
Usage Example Checks