Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Links that can Open and Close (a la BBCode)

I swear I've seen this question in the forums before, but no amount of searching has revealed it. I want to have an in-game bible of sorts where players can get information on almost anything in the game; if they do, I want them to be able to easily open and close a link to get their info then move on to something else without losing the option of the previous link. Best example of this I can think of is how BBCode does its spoiler function.

Is it possible to do this in Harlowe? (Bonus points if it can be something placed off to the side in a tw-sidebar kind of layout!)

Comments

  • Hi,

    If I understand what you want correctly, then this thread may be helpful:

    http://twinery.org/forum/discussion/2717/replacing-text-back-and-forth-without-refreshing-passage

    Following the steps @greyelf gave in that thread, I set up a passage called "Itinerary". In that passage I put all the code and info that I wanted within a div with a class I could style via CSS.
    <div class="itinerary">
    All the passage code and info for my itinerary goes here
    </div>
    


    Then in each passage I wanted the Itinerary to be available I would add the following:

    (display: "Itinerary")

    And then I set that to a fixed position via CSS.... For example:
    .itinerary {
    
      position: fixed;
      top: 20px;
      left:100px;
    
    }
    

    And then the player can open and close the itinerary whenever they want to see what they have available, stats, etc.

    I hope this is helpful.

  • edited June 2015
    EDIT: Oops. Looked right past Feli's link. Better examples there.
    Neoroman wrote: »
    Best example of this I can think of is how BBCode does its spoiler function.

    Is this what you mean?
    There is a [book]<book| on the [table]<table|. 
    
    (click: ?book)[A heavy tome with an age-worn leather cover.]
    
    (click: ?table)[A massive oak dining table.]
    


    Or, maybe this can be better styled to what you seek:
    There is a [book]<book| on the [table]<table|. 
    
    (click: ?book)[(replace: ?book)[heavy tome with an age-worn leather cover]]
    
    (click: ?table)[(replace: ?table)[massive oak dining table]]
    


    See if either of those dogs will hunt.
  • edited June 2015
    Hi,

    If I understand what you want correctly, then this thread may be helpful:

    http://twinery.org/forum/discussion/2717/replacing-text-back-and-forth-without-refreshing-passage

    Following the steps @greyelf gave in that thread, I set up a passage called "Itinerary". In that passage I put all the code and info that I wanted within a div with a class I could style via CSS.
    <div class="itinerary">
    All the passage code and info for my itinerary goes here
    </div>
    


    Then in each passage I wanted the Itinerary to be available I would add the following:

    (display: "Itinerary")

    And then I set that to a fixed position via CSS.... For example:
    .itinerary {
    
      position: fixed;
      top: 20px;
      left:100px;
    
    }
    

    And then the player can open and close the itinerary whenever they want to see what they have available, stats, etc.

    I hope this is helpful.

    I was looking at that thread and thought "this seems a bit much for a simple thing" but what do you know: it gets the job done. It may be a hot mess of passages and text, but at least it works.

    Thanks!
Sign In or Register to comment.