-
Notifications
You must be signed in to change notification settings - Fork 0
Adding Documentation #1
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
base: DocsImprovements
Are you sure you want to change the base?
Conversation
Uploading Documentation onto a clean branch because having 557 Stackedit commits doesn't seem sensible
Uploading Documentation onto a clean branch because having 557 Stackedit commits doesn't seem sensible
docs/components/RectTransform.md
Outdated
| @@ -0,0 +1,60 @@ | |||
| # Components: RectTransform | |||
| **< [Previous Component](/docs/components/README.md)** | **[Back to Components](/docs/components/README.md)** | **[Next Component](/docs/components/UnityEngine.UI.RawImage.md) >** | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing Next links when at the end, and removing the Previous links when at the beginning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree, i initially kept it for the symmetry/aesthetics, but its more important the navigation actually makes sense
docs/components/RectTransform.md
Outdated
| A common Technique is to use Anchors to specify what part of the Parent the UI should be anchored to (Top Left Corner or Dead Center. Etc.) and to use Offsets for Size & Position. | ||
|
|
||
| ## Offsets and Scaling | ||
| Rust will automatically scale Offsets depending on the Player's Resolution, which ensures your Offsets are predictable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest also mentioning that Rust accounts for the client's graphics.uiscale since I still see people believing otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely forgot to mention that, so I've added it to the scaling section as a note
|
|
||
| --- | ||
| before using RawImage, take a look at the Image Component to see if it's better suited for your usecase. | ||
| **< [Previous Component](/docs/components/README.md)** | **[Back to Components](/docs/components/README.md)** | **[Next Component](/docs/components/UnityEngine.UI.RawImage.md) >** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Next Component link location is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks for pointing it out
| @@ -0,0 +1,46 @@ | |||
| # Components: InputField | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be a markdown file. Links to this page are broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noticed it too late, fixed now
docs/Bugs-Tips.md
Outdated
| ### Positioning your CUI alongside rust UI | ||
| for features that augment Rust's existing UI, like when you're working with Furnaces & other storage Inventories, its important to make sure your CUI doesn't interfere with the UI you augment. | ||
|
|
||
| Rust UI uses the same Placement system CUI does. it anchors all of the UI to the Bottom Middle of the Screen and then uses offsets to position each element. by doing the same you can ensure that your CUI is positioned properly, regardless of Screensize & Aspect Ratio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it anchors all of the UI to the Bottom Middle of the Screen
This is true for many elements, but of course not true for the status bars, compass, missions, etc. Also not true for vendor dialog which is anchors to middle center.
Wouldn't hurt to also mention that the computer station UI doesn't use this, to save people time from trying to get that to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i expanded on that section to clarify it based on your feedback, i did choose to show an easy way to find what a UI element is anchored to instead of repeating your list, i did look at the computer station UI and couldn't really figure out what it was doing either so i'm not sure how to address that one
| | `font` | string | the Asset name of the Font you wish to use | | ||
| | `align` | string (enum `TextAnchor`) | the way your Text should be aligned | | ||
| | `color` | string | the default Color of your Text | | ||
| | `verticalOverflow` | string (enum `VerticalWrapMode`) | how Text Overflowing vertically should be handled | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest documenting the enum values and/or providing a link to Unity docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a section on the verticalOverflow enum
| | `lineType` | string (enum `InputField.LineType`) | dictates if the Field should allow multiple Lines & how to handle when the Player presses `enter` | | ||
| | `password` | key presence Field | if the input should be obscured | | ||
| | `needsKeyboard` | key presence Field | prevents default Keyboard behavior (movement, item switching etc) while the field is Focused | | ||
| | `hudMenuInput` | key presence Field | same as above but for Rust UI (Inventory, Crafting, etc.) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth mentioning that this if you try to use needsKeyboard while the hud is open, the hud will be closed when clicking on the input. Can also mention that, unlike needsKeyboard, it doesn't block movement or key binds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i assume with your second sentence you were talking about the hudMenuInput, which i also wasnt aware of. i've added a section to explain this a bit more
| | `sprite` | string | the asset Path to the sprite | | ||
| | `color` | string | the normalized RGBA values of your color | | ||
| | `material` | string | the asset Path to the Material | | ||
| | `imagetype` | string (enum `Image.Type`) | sets the display mode of the Image* | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider documenting the known values and/or linking to Unity docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've added some more information for the imagetype field, but i also used the chance to reiterate that the setting really only does things for preconfigured sprites.
i think particularly the sliced & tiled options could be really useful for server loaded images too so it would be really nice to see the api include fields for this in the future
| | `sprite` | string | the asset Path to the sprite | | ||
| | `color` | string | the normalized RGBA values of your color | | ||
| | `material` | string | the asset Path to the Material | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be awesome to somehow document the known sprite/material values. Not sure if this is the best place for that, since it can change, but perhaps you can document a process by which the allowed values can be determined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont really know an easy way short of digging out asset files from the game, there is a very outdated repo by orange that lists them of somewhat conveniently https://github.com/OrangeWulf/Rust-Docs/blob/master/Extended/Materials.md, but i'm unsure if linking to it in the docs is the best way to go about it
README.md
Outdated
|
|
||
| --- | ||
| ### Disclaimer | ||
| the readme & Documentation is Community maintained it aims to give Developers a starting Point and educate them on effectively using CUIs for their Projects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of sentence capitalization issues throughout the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i fixed most of the capitalization issues & went through it with LanguageTool just to make sure I'd catch all the obvious ones, should be a bit better to read now
Fixed InputField name & added section about Text Selection added notice explaining the default values in the json examples
Improved spelling & fixed capitalization issues added section for Layers in the Basics expanded on Positioning in Bugs-Tips expanded on the imagetype setting for the image component added references to the bugs/error messages in some of the other pages added explanation for hudMenuInput & needsKeyboard fields on Input Component
added note explaining that supplying a skinid of 0 causes client issues
Corrected ordering of all Layer values & added descriptions to Hud & Hud.Menu
| "skinid": 0, | ||
| "fadeIn": 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"fadeIn" has 4 spaces on various pages, but the other fields are using tabs.
PR to collect feedback & improvements