@@ -119,6 +119,29 @@ ProjectScene {
119119 color: priv .loading || ! priv .loaded ? " transparent" : " white"
120120 clip: true
121121
122+ Component {
123+ id: renderedTextBubble
124+
125+ Loader {
126+ property QtObject model: null
127+ active: model ? model .bubbleText !== " " : false
128+ z: model ? model .bubbleLayer : 0
129+
130+ sourceComponent: TextBubble {
131+ type: model .bubbleType
132+ text: model .bubbleText
133+ target: model .renderedTarget
134+ stageScale: root .stageScale
135+ stageWidth: root .stageWidth
136+ stageHeight: root .stageHeight
137+ x: target .x
138+ y: target .y
139+ }
140+
141+ Component .onCompleted : model = modelData
142+ }
143+ }
144+
122145 RenderedTarget {
123146 id: stageTarget
124147 engine: loader .engine
@@ -129,17 +152,9 @@ ProjectScene {
129152 }
130153
131154 Loader {
132- readonly property alias model : stageTarget .stageModel
155+ readonly property alias modelData : stageTarget .stageModel
133156 active: model ? model .bubbleText !== " " : false
134-
135- sourceComponent: TextBubble {
136- type: model ? model .bubbleType : TextBubbleShape .Say
137- text: model ? model .bubbleText : " "
138- target: stageTarget
139- stageScale: root .stageScale
140- stageWidth: root .stageWidth
141- stageHeight: root .stageHeight
142- }
157+ sourceComponent: renderedTextBubble
143158 }
144159
145160 PenLayer {
@@ -220,20 +235,6 @@ ProjectScene {
220235 Component.onCompleted: transform = targetItem.transform[0]
221236 }
222237 }*/
223-
224- Loader {
225- readonly property alias model: targetItem .spriteModel
226- active: model ? model .bubbleText !== " " : false
227-
228- sourceComponent: TextBubble {
229- type: model ? model .bubbleType : TextBubbleShape .Say
230- text: model ? model .bubbleText : " "
231- target: targetItem
232- stageScale: root .stageScale
233- stageWidth: root .stageWidth
234- stageHeight: root .stageHeight
235- }
236- }
237238 }
238239 }
239240
@@ -249,6 +250,12 @@ ProjectScene {
249250 delegate: renderedSprite
250251 }
251252
253+ Repeater {
254+ id: textBubbles
255+ model: loader .sprites
256+ delegate: renderedTextBubble
257+ }
258+
252259 SceneMouseArea {
253260 id: sceneMouseArea
254261 anchors .fill : parent
0 commit comments