Button Click - Javascript Solved

Discussion in 'Buildbox 3.0' started by Scriv, Jan 7, 2019.

  1. Scriv

    Scriv Boxer

    Joined:
    Oct 28, 2018
    Messages:
    50
    Likes Received:
    22
    Hi there

    I'm strugglingg with the menu jump on BB3 and the javascript for ui buttons.

    1) Can anyone confirm what is the most UP UP TO DATE version of BB3 I'm using B#2354 is that right?
    2) a little help on Menu Jump integration would be super helpful
    3) where would one put the Javascript for the button integration? Inside the innit function on a fresh script? I can get it to log the button click but no other code runs inside the {}

    You are all legends. any help with the above is greatly appreceated. Screen Shot 2019-01-07 at 15.29.23.png
     
  2. Tumbleweeds

    Tumbleweeds Boxer

    Joined:
    Dec 18, 2018
    Messages:
    20
    Likes Received:
    9
    Move the code into signal(). Haven't been able to get 'this' working inside init().
     
  3. Scriv

    Scriv Boxer

    Joined:
    Oct 28, 2018
    Messages:
    50
    Likes Received:
    22
    its 1am... i just got it working.

    I realise that you can't define variables from within the button function (I suppose that's because the button isn't actually part of the scene)
    Also any routes to objects within the scene have to be made from scene level not from where the code is stored.
    So I split the event into 2. Screen Shot 2019-01-08 at 01.17.23.png Part 1 is the trigger for the button code that initialises where the code is that youre going to signal. Then...
    Screen Shot 2019-01-08 at 01.17.37.png
    i setup a simple listner script to receive the signal and run the node.... It's messy but it'll work for this game.
    Hopefully future updates will simplify it.

    Night night. Hope this helps someone in the future.
     
    Leighton likes this.
  4. Scriv

    Scriv Boxer

    Joined:
    Oct 28, 2018
    Messages:
    50
    Likes Received:
    22
    He He 'buttspawner';)
     
    Tom King and Leighton like this.
  5. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    #2382 but it has an introduced bug with scene naming.
     

Share This Page