Skip to reading
GDScript Programming & Godot

CenterGUIModel()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Center GUI Model

Fit and center the model displayed inside a GUI 3D model viewer.

Source table from CenterGUIModel(), page 187
Option key / fieldMeaning and inputDefault
GUI guiIdChoose an authored GUI ID.Blank
3D Model elementIdChoose an element inside the selected GUI.Blank

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await CenterGUIModel({"guiId": "hud", "elementId": "topline"})

In use. Offer a Reset View button after the player rotates a model. It targets the GUI viewer, not the scene's active gameplay camera or the model's source file.

Page 187 of 378Permalink
Go to page