# Help with buttons

**URL:** <https://forum.choiceofgames.com/t/help-with-buttons/1207>\
**Category:** ChoiceScript Help\
**Created:** [March 21, 2013, 8:00pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207 "2013-03-21T20:00:19Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dima](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dima/32/932_2.png) [@Dima](https://forum.choiceofgames.com/u/Dima)\
**Post date:** [March 21, 2013, 8:00pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/1 "2013-03-21T20:00:19Z")

</div>

I’ve been having some trouble with adding an additional button at the top, like the ‘Show Stats’ one.

After editing the index and ui.js files it shows up and links to the right scene. When in that scene I would like the button to say ‘Return to game’ (like with the stats screen), however I can’t seem to get it right without messing up the ‘Show Stats’ button.  
Also there’s no ‘Next’ bar at the bottom.

I’ve been going through the wiki but the codes there seem to be from outdated versions. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 21, 2013, 8:25pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/2 "2013-03-21T20:25:42Z")

</div>

Im honestly not 100% myself but I code for alot of people and I have a source to my friend’s and in hers she has that yet nothing I have has that but I looked into it and I found this… not sure if its it though

```

function printFooter() {
  // var footer = document.getElementById('footer');
  // We could put anything we want in the footer here, but perhaps we should avoid it.
  var statsButton = document.getElementById("statsButton");
  if (statsButton) {
    if (window.stats.sceneName == "choicescript_stats") {
      statsButton.innerHTML = "Return to the Game";
    } else {
      statsButton.innerHTML = "Show Stats";
    }
  }
  setTimeout(function() {callIos("curl");}, 0);
}

```

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 21, 2013, 8:29pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/3 "2013-03-21T20:29:56Z")

</div>

Yah, I think its working for me try replacing this code in your ui.js with the one above

```

function printFooter() {
  // var footer = document.getElementById('footer');
  // We could put anything we want in the footer here, but perhaps we should avoid it.
  setTimeout(function() {callIos("curl");}, 0);
}

```

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 21, 2013, 8:39pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/4 "2013-03-21T20:39:57Z")

</div>

XD im in the same boat as you now

---

<div class="post-metadata">

**Author:** ![TIYF](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/tiyf/32/633_2.png) [@TIYF](https://forum.choiceofgames.com/u/TIYF)\
**Post date:** [March 21, 2013, 8:47pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/5 "2013-03-21T20:47:40Z")

</div>

I need help with this too haha

---

<div class="post-metadata">

**Author:** ![Dima](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dima/32/932_2.png) [@Dima](https://forum.choiceofgames.com/u/Dima)\
**Post date:** [March 21, 2013, 8:47pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/6 "2013-03-21T20:47:41Z")

</div>

Thanks for the reply 2Ton, I have the exact same code as in your first post and the stat  
screen isn’t the issue. What I want is for my extra button to do the same thing as the stats button.

I tried copy-paste the code and adjust it to my extra button but that messes up the stats button.

Lol I hope you can make sense out of my ramblings, I’m sleepy.

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 21, 2013, 8:53pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/7 "2013-03-21T20:53:29Z")

</div>

I got it!!! hold on I didnt find specifically the problem but I can fix it I have an updated js for some stuff hold on im just trying to figure out how to post it so you guys can download it… hmmm… Try this?

[https://dl.dropbox.com/u/134916500/All%20you%20need.zip](https://dl.dropbox.com/u/134916500/All%20you%20need.zip)

all you have to do is delete the obsolete js and replace it with the new ones

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 21, 2013, 9:26pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/8 "2013-03-21T21:26:16Z")

</div>

I hope it works for you guys :3

---

<div class="post-metadata">

**Author:** ![Dima](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dima/32/932_2.png) [@Dima](https://forum.choiceofgames.com/u/Dima)\
**Post date:** [March 21, 2013, 9:28pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/9 "2013-03-21T21:28:19Z")

</div>

That doesn’t do anything for me. I think you misunderstood my problem. How the hell do you upload pictures…

What I want is this:  
[![](http://s11.postimg.org/qevhrih0v/statscreen.jpg)](http://postimg.org/image/qevhrih0v/)

On this:  
[![](http://s4.postimg.org/6i0jse1e1/helpscreen.jpg)](http://postimg.org/image/6i0jse1e1/)

And the bar at the bottom is missing for some reason.

\*Edit  
Damn links,

1st: [http://s11.postimg.org/4fp34b06r/statscreen.png](http://s11.postimg.org/4fp34b06r/statscreen.png)  
2nd:[http://s4.postimg.org/sh6yfli8d/helpscreen.png](http://s4.postimg.org/sh6yfli8d/helpscreen.png)

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 21, 2013, 9:35pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/10 "2013-03-21T21:35:14Z")

</div>

Wait… hmmm

Edited: yah actually what I showed you should fix those problems it should make it so the return game shows up when your viewing stats and also the next button should pop up at the bottom, weird its not

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 21, 2013, 9:42pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/11 "2013-03-21T21:42:31Z")

</div>

Oh… wait yes I think I did misunderstand alot… so you want it on the help X\_X omg I feel dumb

let me go look into it ill go look through the source and read through it, and see if you can do that with an additional button, I know you can but im not sure if im capable of doing it, but ill give it a shot

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 21, 2013, 9:52pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/12 "2013-03-21T21:52:49Z")

</div>

In the meanwhile, there is a easier way to do it… since there is already a return to game stat in the main panel you can actually do a choice within the state screen like

```

*choice
  #Help
    [whatever you want on help screen]
    *choice
       #go back
         *goto display

```

That would make it easier but ill keep looking to see if I can remedy the problem so that there is a return to game when you click help WITH the next button

---

<div class="post-metadata">

**Author:** ![Dima](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dima/32/932_2.png) [@Dima](https://forum.choiceofgames.com/u/Dima)\
**Post date:** [March 21, 2013, 10:04pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/13 "2013-03-21T22:04:45Z")

</div>

Thanks I appreciate it 😃 I’ll use your choice idea as a temporary solution

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [March 22, 2013, 7:35am UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/14 "2013-03-22T07:35:03Z")

</div>

Have you tried this method?

> **[Multiple Stat Screens & The Latest Version of Choicescript](https://forum.choiceofgames.com/t/960)**
>
> Note: This is a ‘hack’ and shouldn’t be used if you wish to publish your game through CoG - Instead you should use the supported method of a \*choice command inside a stats screen to emulate multiple stats pages. The documentation for this method...

---

<div class="post-metadata">

**Author:** ![Dima](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dima/32/932_2.png) [@Dima](https://forum.choiceofgames.com/u/Dima)\
**Post date:** [March 24, 2013, 3:27pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/15 "2013-03-24T15:27:28Z")

</div>

I’ve decided to omit the extra buttons, but I tried out the link in your post @CJW and that  
that solved the issue with the ‘Next’ bar. So whenever I do want additional buttons I’ll use that, cheers!

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [March 24, 2013, 3:46pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/16 "2013-03-24T15:46:40Z")

</div>

@Dima No problem, good luck with your game 🙂

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [March 24, 2013, 4:17pm UTC](https://forum.choiceofgames.com/t/help-with-buttons/1207/17 "2013-03-24T16:17:32Z")

</div>

@Dima Same, wish you the best of luck. sorry, I wasn’t much help.
