ViewSizer
Stay organized with collections
Save and categorize content based on your preferences.
AI-generated Key Takeaways
ViewSizer is an interface used to control the size of a ViewRenderable within a Sceneform Scene.
It provides a mechanism to calculate the desired size of an Android View in meters for 3D placement.
The final rendered size is influenced by both the ViewSizer and the Node's world scale.
getSize() is the core method, taking an Android View and returning a Vector3 representing its dimensions in the scene.
Several pre-built implementations exist, like FixedHeightViewSizer, FixedWidthViewSizer, and DpToMetersViewSizer, offering different approaches to sizing.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[],["The `ViewSizer` interface controls the size of a `ViewRenderable` within a `Scene`. Subclasses like `DpToMetersViewSizer`, `FixedHeightViewSizer`, and `FixedWidthViewSizer` determine size based on density-independent pixels per meter, fixed height, or fixed width in meters, respectively. `getSize(View view)` is the method for calculating the desired size of a view. The final displayed size is adjusted by the `getWorldScale()` of the attached `Node`. The method `getSize` return a vector representing the size in the scene, with x being the width and y the height.\n"]]