Game Title

Hi. Is there a way for the location bar to appear after the author name when you first click play. At the moment the location bar appears at the top followed by the 'Game title' then 'Subtitle' (if any), and then the 'Author' (if any), then the location again. I know the location bar can be turned off, but I don't want to do that. I did try looking at the 'StartGame' function, moving some of the script up/down, but to no avail.


Hello,

Try mixing some of these up maybe?

https://github.com/ThePix/quest/wiki/UI-Part-04:-Various-Tricks

(You've got me wanting to do it now!)


I figured out how to move it up and down by pixel or percentage...

By pixel:

JS.eval ("$('#status').css('top', '150px')")

By percentage from the top:

JS.eval ("$('#status').css('top', '22%')")

This will cover everything else up, though...
AND it won't fall under the by-line, per se... I just played with the settings in the HTML Tools until it lined up correctly.

image

http://docs.textadventures.co.uk/quest/guides/modifying_the_ui__advanced_.html

I'm sure you can do the same with the width and everything else (width, margins, etc...)

JS.eval ("$('#status').css('width', '54%')")

image


Here's the default CSS for the status/location bar (just as a reference):

div#status
{
    height: 30px;
    position: fixed;
    top: 0px;
    z-index: 100;
    width: 948px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14pt;
    padding: 0;
    display: none;
}

There are insertAfter and insertBefore functions(?) for moving the panes around, I'm trying to find the equivalent of that right now with no luck.

I saw another one of Pixie's guides concerning CSS somewhere, too...


Here's the missing puzzle piece (or I think it may be):

http://textadventures.co.uk/forum/samples/topic/-sem6m7qe02a6jr9spodig/add-css-and-javascript-to-your-game#eb874969-e476-4a68-ab6d-372e5773b242


Try this.

You'll probably have to adjust the top setting if you have a subtitle.

I don't know what it will look like on a mobile device or tablet...

Complete example game:

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="tester">
    <gameid>858dcb43-f0d5-4224-8091-79a12850810e</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <author>tester maker</author>
    <feature_advancedscripts />
    <start type="script">
      JS.eval ("$('#status').css('top', '22%')")
      JS.eval ("$('#status').css('width', '54%')")
    </start>
    <inituserinterface type="script">
      JS.addText (game.stuff)
    </inituserinterface>
  </game>
  <object name="interface_obj">
    <stuff><![CDATA[
      <style>
        #location {
        top:22%
        }
      </style>
          ]]></stuff>
  </object>
  <object name="room">
    <inherit name="editor_room" />
    <description type="script">
    </description>
    <beforefirstenter type="script">
    </beforefirstenter>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
    <object name="distraction">
      <inherit name="editor_object" />
    </object>
    <turnscript name="location_defaulted">
      <script>
        JS.eval ("$('#status').css('top', '0')")
        JS.eval ("$('#status').css('width', '948px')")
      </script>
      <enabled />
    </turnscript>
  </object>
</asl>

Hi, thanks for that, just tried it out, it moves the location bar, but also obscures the panes on the right, then when you move to another room, the location bar doesn't reset at the top of the screen. I'll have to play around with it and find something else or do a 'fix'.


JS.eval ("$('#status').css('width', '54%')")

⇧⇧⇧⇧ That's the one that will keep it from covering the panes (or cause it to cover the panes).

I only had one room in my example game... I'll have to add another so I can curse the bar not resetting right alongside of you!

UPDATE: I added a room, but can't recreate the error. No matter what my first command is, the bar goes to the top and stays there for the duration.

It may be the build?

Here's mine: Build 5.7.6404.27031

It probably has to do with screen resolution... If that's the case, it would probably involve the margin settings, but I'm not certain.


Speaking of resolution...

Yuck!

This is what it looks like when my window isn't maximized:
image


It might be because I'm clearing the screen when the player enters a new room. I have that option ticked on the 'Room Descriptions' tab


I think what I did in X3 is hide panes and command bar and added a print message script to indicate the player must hit "any" key. After that, I showed the panes and command bar.

If interested I'll explain in more detail.


Thanks Xan, that's great. I'll give it a go.


you may be able to do this too:

// (whatever scripting you're trying to do, that isn't working for you, goes/is here)
// and then do this:
wait {
  ClearScreen
}

// --------------------------

// or, you can try this too:

// (whatever scripting you're trying to do, that isn't working for you, goes/is here)
// and then do this:
on ready {
  wait {
    ClearScreen
  }
}

Log in to post a reply.

Support

Forums