Forums

OverviewV-Play 1 SupportRefresh Flickable › Reply To: Refresh Flickable

OverviewV-Play 1 SupportRefresh Flickable › Reply To: Refresh Flickable
#4375

phil.jahoda

Whenever I say player.loadHighscore() i access the settings.

 

import VPlay 1.0
import QtQuick 1.1

Scene {

  Flickable {

    id: flickable
    x: -200
    y: 20

    width: parent.width / 2
    height: parent.height

    contentWidth: column.width
    contentHeight: column.height
    flickableDirection: Flickable.VerticalFlick

    // The duration of the slide animation for this button
    property int slideDuration: 800

    Column {

      id: column
      spacing: 5
      anchors.centerIn: parent

      Repeater {
        id: repeater
        model: window.numberoflevels

        MenuButton {
          text: getHighScoreText(modelData + 1);
          source: "img/cloud.png"
                  textSize: 10
          fontBold: true
        }
      }
    }

    Behavior on x {
      SmoothedAnimation { duration: 800; easing.type: Easing.InOutQuad }
    }

    function slideIn() {
      x = parent.width - flickable.width
    }

    function slideOut() {
      x = -200
    }
  }

  function getHighScoreText(modelData) {
    return "Level " + (modelData) + " – Score:" + " " + player.loadHighScore("0"+(modelData));
    //+ “, Remaining Arrows: ” + player.loadRemArrows(“0″+(modelData));
  }

  // THE BELOW CODE IS NOT WORKING
  function update() {

    for(var i = 0; i < window.numberoflevels; i++) {

      repeater.childAt(i).text = getHighScoreText(i+1);
    }
  }

  // an so on…
}

 

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