vanilladocs
vanillapunch.com
API / misc/devtools

misc/devtools

고정 레이아웃 상수.

Fixed layout constants.

DevToolsextends Object

짝Counterpart: vanilla-engine DevTools

하이어라키 패널.

  • F2 키로 표시/숨김 토글.
  • 씬 노드 계층 구조를 좌측 트리 + 우측 인스펙터로 표시.
  • 타이틀바 드래그로 패널 이동.
  • 모든 엣지/코너 드래그로 크기 조절.
  • 중앙 구분선 드래그로 좌우 비율 조절.
  • 컴포넌트 헤더 클릭으로 프로퍼티 목록 펼침/접힘 (기본값: 펼침).

Hierarchy panel.

  • The F2 key toggles show and hide.
  • Shows the scene node hierarchy as a left tree and a right inspector.
  • Drag the title bar to move the panel.
  • Drag any edge or corner to resize.
  • Drag the center splitter to change the left and right ratio.
  • Click a component header to expand or collapse its property list. (default: expanded)
예제Example패널을 열고 탭 고르기Open the panel and choose a tab
import { DevTools } from "./build/vanilla.js";

const devTools = new DevTools();
devTools.setActiveTab(1);
devTools.setVisible(true);
console.log(devTools.isVisible(), devTools.getActiveTab());
console.log(devTools.getPanelRect().width > 0, devTools.isFramePerSecondVisible());
생성자constructorconstructor()#0.4.0 부터since 0.4.0소스source

생성.

Constructor.

짝Counterpart: vanilla-engine DevTools.new

메서드methodsetEngine(engine)#0.4.0 부터since 0.4.0소스source

엔진 설정.

Engine configuration.

engineEngine
개발 도구가 들여다볼 엔진. (기즈모 표시는 도구가 맡으므로 강제 기즈모를 끈다)The engine the dev tools look into. (the dev tools own gizmo display, so the forced gizmos are turned off)
메서드methodsetRootNodes(rootNodes)#0.4.0 부터since 0.4.0소스source

루트 노드 목록 설정.

Sets the root node list.

rootNodesTransformNode[]
트리에 보일 루트 노드 목록. (루트는 처음부터 펼친다)The list of root nodes shown in the tree. (roots start expanded)

짝Counterpart: vanilla-engine DevTools.set_root_nodes

메서드methodisVisible()#0.4.0 부터since 0.4.0소스source

표시 여부 반환.

Returns whether it is visible.

반환Returnsboolean 패널이 보이면 참.True if the panel is visible.

짝Counterpart: vanilla-engine DevTools.is_visible

메서드methodsetVisible(isVisible)#0.4.0 부터since 0.4.0소스source

보이기와 숨기기. (F2 와 같다. 보일 때 패널을 창 오른쪽 아래에 붙이고, 모든 기즈모 설정을 건다)

Shows and hides. (same as F2. When shown, the panel is attached to the bottom right of the window and every gizmo setting is turned on)

isVisibleboolean
패널을 보이면 참, 숨기면 거짓.True to show the panel, false to hide it.

짝Counterpart: vanilla-engine DevTools.set_visible

메서드methodgetActiveTab()#0.4.0 부터since 0.4.0소스source

지금 탭 반환. (0 Statistics, 1 Node Hierarchy, 2 Local Storage, 3 Settings)

Returns the current tab. (0 Statistics, 1 Node Hierarchy, 2 Local Storage, 3 Settings)

반환Returnsnumber 지금 탭 번호. (0 Statistics, 1 Node Hierarchy, 2 Local Storage, 3 Settings)The current tab number. (0 Statistics, 1 Node Hierarchy, 2 Local Storage, 3 Settings)

짝Counterpart: vanilla-engine DevTools.get_active_tab

메서드methodsetActiveTab(tabIndex)#0.4.0 부터since 0.4.0소스source

탭 설정. (없는 탭이면 무시)

Sets the tab. (ignored if there is no such tab)

tabIndexnumber
탭 번호. (0 Statistics, 1 Node Hierarchy, 2 Local Storage, 3 Settings)The tab number. (0 Statistics, 1 Node Hierarchy, 2 Local Storage, 3 Settings)

짝Counterpart: vanilla-engine DevTools.set_active_tab

메서드methodgetSelectedNode()#0.4.0 부터since 0.4.0소스source

고른 노드 반환.

Returns the selected node.

반환ReturnsTransformNode | null 고른 노드. (없으면 null)The selected node. (null if none)

짝Counterpart: vanilla-engine DevTools.get_selected_node

메서드methodsetSelectedNode(node)#0.4.0 부터since 0.4.0소스source

노드 고르기. (인스펙터 스크롤은 맨 위로)

Selects a node. (the inspector scroll goes back to the top)

nodeTransformNode | null
고를 노드. (null 이면 선택을 푼다)The node to select. (null clears the selection)

짝Counterpart: vanilla-engine DevTools.set_selected_node

메서드methodisNodeExpanded(node)#0.4.0 부터since 0.4.0소스source

트리에서 노드를 펼쳤는지.

Whether the node is expanded in the tree.

nodeTransformNode
확인할 노드.The node to check.

반환Returnsboolean 트리에서 그 노드를 펼쳤으면 참.True if that node is expanded in the tree.

짝Counterpart: vanilla-engine DevTools.is_node_expanded

메서드methodsetNodeExpanded(node, isExpanded)#0.4.0 부터since 0.4.0소스source

트리에서 노드 펼치기와 접기.

Expands and collapses a node in the tree.

nodeTransformNode
펼치거나 접을 노드.The node to expand or collapse.
isExpandedboolean
펼치면 참, 접으면 거짓.True to expand, false to collapse.

짝Counterpart: vanilla-engine DevTools.set_node_expanded

메서드methodinspectNode(node)#0.4.0 부터since 0.4.0소스source

노드 검사. (보이고, Node Hierarchy 탭으로, 조상을 펼치고 그 노드를 고른다, 그 노드 자신은 펼치지 않는다)

Inspects a node. (shows the panel, switches to the Node Hierarchy tab, expands the ancestors and selects the node, does not expand the node itself)

nodeTransformNode
검사할 노드.Node to inspect.

짝Counterpart: vanilla-engine DevTools.inspect_node

예제Example자식 노드를 검사하면 부모가 펼쳐진다Inspecting a child node expands its parent
import { DevTools, WorldNode } from "./build/vanilla.js";

const parentNode = new WorldNode();
const childNode = new WorldNode();
parentNode.addChild(childNode);
const devTools = new DevTools();
devTools.inspectNode(childNode);
console.log(devTools.isVisible(), devTools.getActiveTab(), devTools.isNodeExpanded(parentNode), devTools.getSelectedNode() === childNode);
메서드methodgetPanelRect()#0.4.0 부터since 0.4.0소스source

패널 영역 반환. (창 안쪽 논리 좌표)

Returns the panel area. (logical coordinates inside the window)

반환ReturnsRect 패널 영역. (창 안쪽 논리 좌표)The panel area. (logical coordinates inside the window)

짝Counterpart: vanilla-engine DevTools.get_panel_rect

메서드methodisPointerInsidePanel()#0.4.0 부터since 0.4.0소스source

현재 터치 위치가 패널 내부에 있는지 반환.

Returns whether the current touch position is inside the panel.

반환Returnsboolean 지금 포인터가 패널 안에 있으면 참. (패널이 숨겨져 있으면 거짓)True if the pointer is inside the panel right now. (false while the panel is hidden)

짝Counterpart: vanilla-engine DevTools.is_pointer_inside_panel

메서드methodtick(timeDelta)#0.4.0 부터since 0.4.0소스source

갱신.

Update.

timeDeltanumber
지난 프레임과의 간격. (초)Interval since the last frame. (seconds)

짝Counterpart: vanilla-engine DevTools.tick

메서드methoddraw(graphic)#0.4.0 부터since 0.4.0소스source

출력.

Draw.

graphicGraphic
그릴 그래픽.Graphic to draw with.

짝Counterpart: vanilla-engine DevTools.draw

메서드methodisFramePerSecondVisible()#0.4.0 부터since 0.4.0소스source

FPS 표시 여부 반환.

Returns whether the FPS display is on.

반환Returnsboolean Settings 의 Show FPS 가 켜졌으면 참. (켜지면 draw 가 패널을 닫아도 창 왼쪽 위에 FPS 를 그린다)True if Show FPS in Settings is on. (when on, draw shows the FPS at the top left of the window even with the panel closed)

짝Counterpart: vanilla-engine DevTools.is_frame_per_second_visible