이 페이지에서

Scene2D QML Type

이 타입을 사용하면 QML을 텍스처로 렌더링할 수 있으며, 이 텍스처는 3D 씬의 일부로 활용될 수 있습니다. 더 보기...

Import Statement: import QtQuick.Scene2D 2.12
In C++: QScene2D
Status: Deprecated

이 유형은 더 이상 사용되지 않습니다. 새로운 코드에서는 이 유형을 사용하지 않는 것을 강력히 권장합니다.

속성

상세 설명

이 오브젝트는 RenderControl을 사용하여 주어진 아이템을 오프스크린 표면에 렌더링하며, 이 표면은 사용자가 제공한 텍스처에 연결됩니다. 이를 통해 컴포넌트는 중간 복사 과정 없이 텍스처에 직접 렌더링할 수 있으며, 사용자는 3D 씬에서 텍스처가 사용되는 방식을 자유롭게 지정할 수 있습니다.

Scene2D를 사용하는 엔티티는 해당 유형과 연결되어 아이템과의 상호작용을 가능하게 할 수 있습니다. 엔티티에 ObjectPicker 컴포넌트가 있는 경우, 해당 피커의 선택 이벤트가 Scene2D로 전송되어 마우스 이벤트로 변환된 후 최종적으로 아이템으로 전송됩니다.

참고: 마우스이벤트만 지원됩니다. 이 아이템은 키보드 입력을 지원하지 않습니다.

사용법:

Entity {
    id: sceneRoot

    // specify Scene2D inside the entity hierarchy
    Scene2D {
        // specify output
        output: RenderTargetOutput {
            attachmentPoint: RenderTargetOutput.Color0
            texture: Texture2D {
                id: textureId
                width: 1024
                height: 1024
                format: Texture.RGBA8_UNorm
            }
        }
        // specify entities
        entities: [entityId]

        // specify rendered content
        Rectangle {
            color: "red"
        }
    }

    Entity {
        id: entityId

        property Material material: TextureMaterial {
            texture: textureId
        }
        property ObjectPicker picker: ObjectPicker {
            hoverEnabled: true
            dragEnabled: true
        }
        ...

속성 문서

entities : list<Entity>

Scene2D 객체와 연결된 엔티티 목록을 보관합니다. 엔티티에 ObjectPicker가 있는 경우, 해당 엔티티의 선택 이벤트가 Scene2D 로 전송되어 마우스 이벤트로 변환됩니다.

item : Item

Scene2D 에 의해 텍스처로 렌더링된 아이템을 보유합니다.

mouseEnabled : bool

렌더링된 항목에 대해 마우스 이벤트가 활성화되어 있는지 여부를 나타냅니다. 마우스 이벤트는 ` Scene2D`에 추가된 엔티티의 오브젝트 선택 이벤트에서 생성됩니다. 기본적으로 마우스는 활성화되어 있습니다.

참고: 백엔드에서 오브젝트 선택이 이루어지기 때문에, 아이템으로 전송되는이벤트는 한 프레임 정도 지연됩니다.

output : RenderTargetOutput

Scene2D 가 렌더링할 위치를 지정하는 RenderTargetOutput을 포함합니다.

renderPolicy : enumeration

이 Scene2D 의 렌더링 정책을 포함합니다.

  • Continuous: Scene2D 가 지속적으로 렌더링 중입니다. 이것이 기본 렌더링 정책입니다.
  • SingleShot: Scene2D 는 텍스처에 한 번만 렌더링한 후, 렌더링에 할당된 리소스를 해제합니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.