Results 1 to 7 of 7
  1.    #1  
    ok so for my own knowledge/learning, I'm trying to create some sort of score keeping app, similar to 'Game Counter' in the app catalog, but I want to substitute the # for an image. For example, I want the #1 to be 'image1.png' and #2 to be 'image2.png', etc...is there a way to do this using a simple increment function (score++)? Any help is greatly appreciated!!
  2.    #2  
    by the way, I'm using some of the tutorials found on this site for the basic function:

    WebOS Programming - Beyond 'Hello World'
  3. #3  
    Quote Originally Posted by cdawg62184 View Post
    ok so for my own knowledge/learning, I'm trying to create some sort of score keeping app, similar to 'Game Counter' in the app catalog, but I want to substitute the # for an image. For example, I want the #1 to be 'image1.png' and #2 to be 'image2.png', etc...is there a way to do this using a simple increment function (score++)? Any help is greatly appreciated!!
    When referencing the image in your assist coding, reference it as
    Code:
    ‘images/image’ + this.someScore + ‘.png’
  4. j0sh097's Avatar
    Posts
    88 Posts
    Global Posts
    95 Global Posts
    #4  
    Maybe this will help you. Just something I cooked up on the spot that I think addresses your question. Change the extension to .htm
    Attached Files Attached Files
  5.    #5  
    so (as I said, I'm a newbie in coding) if I put in the setup assistant function:

    this.player1 = 0;
    this.controller.get("player1score").update(this.player1);

    then on the button tap:

    this.player1++;
    this.controller.get("player1score").update(this.player1);

    where specifically would that code go that you posted? I know I need to upload images '1.png', '2.png', etc...do I need an image for '0.png'? Thanks for the help by the way!
  6.    #6  
    Quote Originally Posted by j0sh097 View Post
    Maybe this will help you. Just something I cooked up on the spot that I think addresses your question. Change the extension to .htm
    wow ok that looks interesting!...confused still but will have to try this right when I get home, thanks!
  7. #7  
    k, here is some sample code from an app I'm working on:

    in HTML file
    Code:
    <img id="my-rating" border="0" src="images/rate-0-0.png" Align="left"></img>
    in assistant
    Code:
    var beerViewMyRatingElement = this.controller.get("my-rating");
    beerViewMyRatingElement.src = "images/rate-" + BKPrefs.defaultRateIcons + 
    	"-" + this.beerL.list[this.beerIndex].myScore + ".png";
    Hope that makes sense.

Posting Permissions