Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Shader Effect meets Marquee

$
0
0
Hi, I’m trying to combine shader and marquee effect and having trouble with it. I started off with a simple project: Rectangle {     id: master     width: 800     height: 480         Image {      id: bgpic      source: "images/bg.jpg"     }                         Rectangle {                             anchors.centerIn: parent                             width: 300                             height: 30                             color: "transparent"                             clip: true                               Text {                                 id: label                                 color: "white"                                 font.pointSize: 24;                                 text: "hello world1 hello world2 hello world3 hello world4 hello world5 hello world6"                                 x: parent.width                                   PropertyAnimation on x { running: true; from: label.x ; to: -label.width; duration: 50000; loops: Animation.Infinite }                             }                             MouseArea {                                 anchors.fill: parent                                 onClicked: {                                     Qt.quit();                                 }                             }                         }   } This example runs a simple marquee effect: the text rotates inside the shorter rectangle box, using transparency. Then I tried to use shaders in order to stretch the text box from nil to full height – and that works But when I try to combine both elements – the shader dropdown effect and the marquee rotating effect – it won’t work. I found out that the marquee effect is obtained mainly through the clip:true property in the rectangle outside the text element, I have tried applying that to my ShaderEffect, or ShaderEffectSource or even just leave the Text/Rectangle element dealing with it, but the shader resulting from those won’t add the dropdown stretch effect to the supposedly already running marquee effect. Do any of you know if what I’m trying is possible with Qt5 and if so, how could I do it? I will try to supply more visual elements to better relay my objective, in case this is just too confusing. Thanks in advance!

Viewing all articles
Browse latest Browse all 4972

Trending Articles