-
-
Notifications
You must be signed in to change notification settings - Fork 1k
[Draft] Remove depth from Stride UI #2605
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: master
Are you sure you want to change the base?
Conversation
Removed Depth related properties from the UI. Switched to using Size2F instead of Vector2/3 when appropriate for better clarity of intent. Test csprojs contain compile errors still. Rendering not respecting DepthOffset currently.
This is PR is not ready to merge yet.
Could use a second set of eyes on the UI rendering, even tested by hard coding it, and I still can't get the boxes to render with a depth offset. |
So after a good bit of using the debugger to step through the code I found that the 'issue' with the UI depth rendering is with the The |
I understand this PR is not ready, But glancing through there a lot of breaking changes in PR. Public variables being deleted, maybe some name changes, Public variable type changes.
|
Thanks for taking a look @TranquilAbyss! I thought about it, but there are a few reasons why I didn't do that. The UI system is pretty much un-used (as far as I can tell), and the when it is used, the positioning related APIs are even less likely to be touched (normally it is like images for items in a inventories and such). So the number of people these breaking changes would effect are very small (again, as far as I can tell). So it didn't seem worth the overhead. Plus, by its nature it is a breaking change since it is removing a feature from the UI. My expectation was that the PR would only be merged in for the next major release because of this. So again, less worried about breaking changes. |
Missed this one in the last commit
If we were to introduce multiple breaking changes I think it would make sense to bundle it with a couple features. And have at least one more version were those properties are marked as deprecated to notify users |
@Eideren Yeah totally makes sense to have some features as well. But wanted to avoid bloating a PR with multiple things. Though that is my tendency haha. For deprecation, would it maybe make sense to have a version where the only change is marking things with |
I agree, you can create another PR forked from this branch were you introduce new features, we would merge this one first and the second one with new features soon after
Yes, just mention that those still work as is but will be removed in a future version, and point to an existing stable alternative between the two versions if there is one.
We can't do much in that regard |
{ | ||
get | ||
{ | ||
switch (index) |
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.
You can use the switch pattern here. It has a nicer syntax.
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 totally agree, I was opting to keep the changes to the type as similar to the other Stride Mathmatics types as possible to keep the source code and usage consistent. I figured it was better to just update the mathmatics types all at once in another PR, then to have some using one convention and others using another.
} | ||
|
||
/// <summary> | ||
/// Implements the operator <c>/</c>, component wise. |
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.
Description of a method shouldn't explain what they implement but what they do.
For instance: "Divides the first size by the second, component-wise".
return null; | ||
|
||
var ray = new Ray(new Vector3(worldPosition.X, worldPosition.Y, uiComponent.Resolution.Z + 1), -Vector3.UnitZ); | ||
var ray = new Ray(new Vector3(worldPosition.X, worldPosition.Y, 1000 + 1), -Vector3.UnitZ); |
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.
1000 seems arbitrary. Consider naming a constant in the class and use it.
PR Details
Removes most Depth related features of the runtime UI system. Including depth based layout, scrolling, and rendering thickness.
Elements can still be offset along the Z axis by setting the new
DepthOffset
property. Offset is relative to parent element's `DepthOffset.Related Issue
#2489
Types of changes
Checklist