Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create DrawGrid.json #1174

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Create DrawGrid.json #1174

wants to merge 4 commits into from

Conversation

TheGemDev
Copy link
Contributor

draw a virtual grid.

image image image

@TheGemDev TheGemDev requested a review from a team as a code owner February 18, 2024 15:54
@Oxey405
Copy link
Member

Oxey405 commented Feb 18, 2024

Can you provide the extension please ?
(edit) and an example project

@TheGemDev
Copy link
Contributor Author

Project - Draw Grid.zip

Extension -
Draw Grid Extension.zip

Copy link
Member

@Oxey405 Oxey405 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's a great idea but there are a few things to fix I think before this gets published

  1. Performance
    Performance is really bad because of how you draw the cells (using a loop)
    At least you should warn people that it's gonna take a long time to render for fine-grain loops
  2. Coloring
    I think it would also be great to explain how to change the color of the grid for example in the description of the extension, the action or in a help page

Other than that it looks great :)

@Oxey405
Copy link
Member

Oxey405 commented Feb 18, 2024

Project - Draw Grid.zip

Extension - Draw Grid Extension.zip

Thanks

@D8H
Copy link
Contributor

D8H commented Feb 18, 2024

Performance is really bad because of how you draw the cells (using a loop)

The issue is not the loop. It's the instance creation.

This example has events that draw a grid:
https://gdevelop.io/game-example/free/snap-object-to-grid

@TheGemDev
Copy link
Contributor Author

fixed the performance and added a way to change colors in the action. Also, if no instance of the shape painter object exists, the action creates one.

image

@D8H
Copy link
Contributor

D8H commented Mar 12, 2024

What happens when the camera is moved?
Can extension users use the grid to debug path finding of a game with scrolling?
What do you think about making a behavior that updates the grid when needed?

@D8H D8H mentioned this pull request Mar 19, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants