Scene2D QML Type
この型を使用すると、QMLをテクスチャとしてレンダリングすることができ、そのテクスチャを3Dシーンの一部として利用できます。詳細...
| Import Statement: | import QtQuick.Scene2D 2.12 |
| In C++: | QScene2D |
| Status: | Deprecated |
この型は非推奨です。新しいコードでの使用は強く推奨しません。
プロパティ
- entities : list<Entity>
- item : Item
- mouseEnabled : bool
- output : RenderTargetOutput
- renderPolicy : enumeration
詳細な説明
このオブジェクトは、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 に追加されたエンティティのオブジェクト選択イベントから生成されます。デフォルトでは、マウスは有効になっています。
注: オブジェクトの選択処理がバックエンドで行われるため、アイテムに送信されるイベントは 1フレーム分遅延します。
output : RenderTargetOutput
Scene2D のレンダリング先を指定するRenderTargetOutputを保持します。
renderPolicy : enumeration
この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.