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

docs(types.ts): add readd() examples #838

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

SG-SWE073
Copy link
Contributor

Saw there was some confusion on how to use readd(), so I added some examples in jsDoc.

@lajbel
Copy link
Contributor

lajbel commented Mar 27, 2024

I feel that the example is too long, could we reduce the components in the example objects? with sprite and pos should be enough

Removed some components and text
@SG-SWE073
Copy link
Contributor Author

So I updated and shortened some of the unneeded components. This brought up an interesting question to me " Why does it feel too long?", and I think that is because it is near the other examples that are short and don't need much explanation ( like move(), onClick(), fixed() etc.).
There are some long examples already like state() and body(), that might need some explaining, and imo, the docs should be able to provide that to the users without worrying about the length of the doc or its neighboring examples.

I think the solution to this would be to only show the current example, or clicked on component from the sidebar, on its own page, so A) the explanation can be as long as needed. B) The user isn't seeing everything all at once ( doom scroll ).

Here are some examples of what I mean:
Three.js creating text has it's own page: https://threejs.org/docs/index.html#manual/en/introduction/Creating-text
Unity lighting is subdivided with their own pages: https://docs.unity3d.com/Manual/choose-a-lighting-setup.html

I know there are other issues that should be taken care of first, but maybe this can be considered for v4000-v5000.

After removing scale, one of the sprites pos needed to be adjusted to overlap other sprite in demonstration. 
Also, area() is needed as well, because without area(), kaboom will throw an error "purpleBean is not a function" when using "purpleBean.onClick()".
Not sure if this is a bug or intended like that, but might explain one of the reasons why people get errors often.
@SG-SWE073
Copy link
Contributor Author

Does the code need to be adjusted any further, or is it good to go?

src/types.ts Outdated
* sprite("bean"),
* pos(200,140),
* color(255, 255, 255),
* area(),
Copy link
Contributor

Choose a reason for hiding this comment

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

There's an extra indentation?

@lajbel
Copy link
Contributor

lajbel commented Apr 5, 2024

Is looking good for me, only that little thing

@SG-SWE073
Copy link
Contributor Author

Indents should be removed now with recent commit

@lajbel lajbel self-requested a review April 5, 2024 21:10
@lajbel lajbel merged commit ab2b3d6 into replit:master Apr 5, 2024
2 checks passed
@lajbel
Copy link
Contributor

lajbel commented Apr 5, 2024

Thank you for your contribution to documentation! 😇

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.

2 participants