Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Add a utility to lay out actors in a grid #492

Merged
merged 7 commits into from
Feb 28, 2020
Merged

Conversation

stevenvergenz
Copy link
Contributor

I must've implemented this half a dozen times by now. Finally I have a grid layout that's reusable!

Copy link
Contributor

@eanders-ms eanders-ms left a comment

Choose a reason for hiding this comment

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

I like the concept of a layout utility, but there are some additional features we should include. Can we back up and have a design session?

Copy link
Member

@tombuMS tombuMS left a comment

Choose a reason for hiding this comment

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

Agree with @eanders-ms on a design PR for this.

@stevenvergenz
Copy link
Contributor Author

I'm surprised to hear this, I thought tables were pretty self-explanatory, with pre-defined expectations. Is this PR missing features that are so badly needed that shipping without the feature is worse than not having the layout at all?

@eanders-ms
Copy link
Contributor

A grid layout utility is worthwhile addition. If it is going to be an SDK component, it just needs a design review. Some ideas I'd like to cover:

  • Ability to arrange the grid on a surface of a sphere, cylinder, or plane (or on the surface of any primitive?)
  • Ability to layout the grid tiled or radial.
  • How the objects should orient in relation to their surface position (none, face-center, face-center-reversed, face-parent, etc.).

MRTK has something like this. See: https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/README_ObjectCollection.html

@stevenvergenz
Copy link
Contributor Author

@eanders-ms These other modes do seem useful, but their lack shouldn't disqualify this PR I think. Perhaps I could simply rename the utility PlanarGridLayout?

@eanders-ms
Copy link
Contributor

You're suggesting separate classes for different surface types? SphericalGridLayout, etc? I'm fine with that design. As we add more functionality, a singular layout class trying to be all things would eventually grow cumbersome.

colWidths[cell.column], rowHeights[cell.row]
);

cell.contents.transform.local.position = gridAlign.add(cellPosition).add(cellAlign);
Copy link
Contributor

@eanders-ms eanders-ms Feb 26, 2020

Choose a reason for hiding this comment

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

cell.contents.transform.local.position [](start = 3, length = 38)

Would be nice: Option to interpolate this change. #Resolved

Copy link
Contributor Author

@stevenvergenz stevenvergenz Feb 28, 2020

Choose a reason for hiding this comment

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

Easy to add, done! #Resolved

@eanders-ms eanders-ms dismissed their stale review February 26, 2020 20:09

revoking review

@stevenvergenz
Copy link
Contributor Author

I've added a design document, and made some naming tweaks. Review?

}
}
appearance: { meshId: ball.id }
}})
Copy link
Contributor

@eanders-ms eanders-ms Feb 28, 2020

Choose a reason for hiding this comment

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

semicolon :) #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is still mid-statement, can't put a semi-colon here.


In reply to: 385870701 [](ancestors = 385870701)

Copy link
Contributor

@eanders-ms eanders-ms Feb 28, 2020

Choose a reason for hiding this comment

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

Oops I misread it. #Closed

) { }

/** The number of columns in this grid. */
public columnCount() {
Copy link
Contributor

@eanders-ms eanders-ms Feb 28, 2020

Choose a reason for hiding this comment

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

columnCount [](start = 8, length = 11)

I suggest making this and the rest getters. Or, prefix the method name with get --> getColumnCount #Closed

* The width of a particular column.
* @param i The column index.
*/
public columnWidth(i: number) {
Copy link
Contributor

@eanders-ms eanders-ms Feb 28, 2020

Choose a reason for hiding this comment

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

columnWidth [](start = 8, length = 11)

Suggest naming this getColumnWidth #Closed

contents: label
});
}
buttonGrid.applyLayout();
Copy link
Contributor

@eanders-ms eanders-ms Feb 28, 2020

Choose a reason for hiding this comment

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

applyLayout [](start = 13, length = 11)

How about making this animate? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not?


In reply to: 385873835 [](ancestors = 385873835)

Copy link
Contributor

@eanders-ms eanders-ms left a comment

Choose a reason for hiding this comment

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

🕐

Copy link
Contributor

@eanders-ms eanders-ms left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Member

@tombuMS tombuMS left a comment

Choose a reason for hiding this comment

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

:shipit:

@stevenvergenz stevenvergenz merged commit 8ce85cf into red Feb 28, 2020
@stevenvergenz stevenvergenz deleted the stvergen/grid-layout branch February 28, 2020 21:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants