研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly > MetricsManager > getToolboxMetrics
获取工作区上工具箱的宽度、高度和位置(以像素坐标表示)。如果工作区使用的是简单工具箱(而非类别工具箱),则宽度和高度均返回 0。要获取简单工具箱的宽度和高度,请参见 。
Signature:
getToolboxMetrics(): ToolboxMetrics;
返回:
ToolboxMetrics
具有工具箱宽度、高度和位置的对象。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-11。
[null,null,["最后更新时间 (UTC):2024-10-11。"],[[["The `getToolboxMetrics()` method retrieves the dimensions and position of the toolbox on the workspace."],["It returns a `ToolboxMetrics` object containing width, height, and position data."],["For workspaces with simple toolboxes, width and height will be 0; use alternative methods for those dimensions in such cases."]]],[]]