How to change speed of "dying" items?

Discussion in 'Archive - LWC 2.1' started by Konrad, Jun 20, 2012.

  1. Konrad New Guy

    Member Since:
    Jun 20, 2012
    Message Count:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    I have one question about these moving items. Is it possible to change sth in the src files, so that clicked items won't move any more? Or move faster/slower?

    -- edited --
    Sorry, I've found that. Now I have soma layer issues - "living" image is moving below the dead one... Is it possible to move these "living" objects above (let's say to the upper layer) these dead ones?
  2. Jerry-me New Guy

    Member Since:
    Jan 6, 2012
    Message Count:
    85
    Likes Received:
    14
    Trophy Points:
    0
    With the 2.0 version you’re not able to make image layers and the current image order is determined based on when the images are loaded to the canvas. This means the newest loaded images will always be on top while the older images will be behind them based on when they are loaded.

    I don’t know the new release will have this option or not but it depends on the LWC Team.
  3. Konrad New Guy

    Member Since:
    Jun 20, 2012
    Message Count:
    3
    Likes Received:
    0
    Trophy Points:
    0
    OK. I get it. Pity, cause I had one great idea :)
  4. honuproductionsllc New Guy

    Member Since:
    Feb 26, 2013
    Message Count:
    7
    Likes Received:
    2
    Trophy Points:
    0
    Love this app. Just a hacker at Java though -and after 50+ builds to test slowing down the Pop state (e.g. pop .png becomes a fortune ;) it scrolls too fast to read. Kindly, how did/do you slow down the dying state? It made sense to me to tinker somewhere here : Pop_Item.java, line 23: private int life = (test higher values?); // milliseconds .. and... line 68 : (255 * (1 - (this.age / this.life)))); (increase value?). ...Cheers.
  5. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    What exactly do you mean by "dying"?
  6. honuproductionsllc New Guy

    Member Since:
    Feb 26, 2013
    Message Count:
    7
    Likes Received:
    2
    Trophy Points:
    0
    Thanks - what I mean is, when the user clicks on the falling items, and the pop items appears in it's place, it "scrolls" too fast. I want to slow it down, because I am using the png pop item as a text item instead, and need to slow it down for folks to read.
  7. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    The logic for that is located in this piece of code in SBLiveWallpaper.java:
    Code (text):
                        else if (!mPopStyle.equals("none")) {
                            if (mPopStyle.equals("text")) {
                                mPopItems.add(new Pop_Item(randomPopText, calcSpawnPosition(i, randomPopText, mPaint_PopText), 300, mPaint_PopText));
                            }
                            else if (mPopStyle.equals("image")) {
                                mPopItems.add(new Pop_Item(randomPopItem, posItem, 350));
                            }
                            else if (mPopStyle.equals("both")) {
                                if (Math.random() < 0.5)
                                    mPopItems.add(new Pop_Item(randomPopText, calcSpawnPosition(i, randomPopText, mPaint_PopText), 300, mPaint_PopText));
                                else
                                    mPopItems.add(new Pop_Item(randomPopItem, posItem, 350));
                            }
                        }
    Depending on your interaction style, you should play with the numbers found in brackets of Pop_Item. They are the ones that define the lifetime of each pop item. I am ashamed to admit that I don't recall what units the numbers are in. Play around and you'll see that they slow down the higher the number.
    Maximus likes this.
  8. honuproductionsllc New Guy

    Member Since:
    Feb 26, 2013
    Message Count:
    7
    Likes Received:
    2
    Trophy Points:
    0
    You are amazingly generous and thoughtful, thank you for you time !
    Maximus likes this.

Share This Page