Forums

OverviewV-Play 1 Support › LineItem opacity

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5935

    Heini

    Hi,

    it seems that the LineItems opacity property does not work. Setting it to 0 does not hide the line, while visible:false works fine. The problem is, that I would like to fade it out with a NumberAnimation, so I need to use opacity.

    Greetings

    Heini

    #5940

    Alex
    V-Play Team

    Hi Heini,

    i created 2 examples with which i just checked your issue, both work for me. Please try them too and let me know if there are also any issues.

    1. Move slider to change the opacity of the LineItem

    import VPlay 1.0
    import QtQuick 1.1
    GameWindow {
      id: window
      width: 960
      height: 640
      Scene {
        id: mainScene
        width: 480
        height: 320
    
        Column {
          anchors.right: parent.right
          width: 200
          Text {
            text: "opacity "+slider.value
            color: "white"
          }
          Slider {
            id: slider
            width: parent.width
            minimumValue: 0
            maximumValue: 1
            defaultValue: 1
            stepSize: 0.1
          }
        }
    
        LineItem {
          opacity: slider.value
          points: [
            {"x":100, "y":100},
            {"x":300, "y":300}
          ]
        }
      }
    }

     

    2. The LineItem fades in and out every second

    import VPlay 1.0
    import QtQuick 1.1
    
    GameWindow {
      id: window
      width: 960
      height: 640
      Scene {
        id: mainScene
        width: 480
        height: 320
    
        LineItem {
          id: lineItem
          points: [
            {"x":100, "y":100},
            {"x":300, "y":300}
          ]
          Behavior on opacity {
            NumberAnimation{duration: 500}
          }
        }
    
        Timer {
          interval: 1000
          running: true
          repeat: true
          onTriggered: {
            lineItem.opacity = lineItem.opacity === 0 ? 1 : 0
          }
        }
      }
    }

    Cheers,
    Alex

     

    #5942

    Heini

    Hi Alex,

    i tryed both examples, but none of them is working for me. The LineItems opacity does not change when moving the slider or when the timer triggerted.

    Thanks

    Heini

    #5956

    Heini

    Hi,

     

    updating to the latest V-Play version solved this problem.

     

    Cheers

    Heini

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support