intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Feb 22, 2019 10:41 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Text format et. al.
PostPosted: Thu Nov 22, 2018 1:23 pm 
Offline

Joined: Sat May 21, 2016 2:48 pm
Posts: 39
Hello, all:

Can't find in the documentation the following items -- if you could give me a push, greatly appreciated:

Changing text color
Changing text type (underline, italics)

Printing the description of a room (for example, when executing a rule).

Thank you!


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Text format et. al.
PostPosted: Thu Nov 22, 2018 11:43 pm 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2899
Location: US - Central
Emily Short's "Basic Screen Effects" enables color effects in a Zcode project. That extension should be in the Public LIbrary inside of Inform.
Quote:
Basic Screen Effects implements the following effects: pauses to wait for a keypress from the player; clearing the screen; changing the color of the foreground font; and changing the color of the background. Color changes function only on the Z-machine.

Tag your "[italic type]italic[roman type] text" in tags.
http://dhayton.haverford.edu/wp-content ... I_5_9.html
I make abbreviations for everything:

Spoiler: show
Quote:
This tiny bit of code adds shortcuts for common text formatting to save typing out common formatting such as [bracket]paragraph break[close bracket] hundreds of times. The code goes within brackets inside quotation marks as a text substitution.

i is italic type.

b is bold type.

f is fixed letter spacing. (usually will display as Courier, or the preferred monospace font in an interpreter)

v is variable letter spacing. (normal variable with font, the default)

p is paragraph break

l is line break

/ is roman type (cancel formatting - standard text display)

lb is left bracket (bracket)- "[bracket]"

rb is right bracket (close bracket) - "[close bracket]"


Code:
Text Abbreviations by Hanon Ondricek begins here.

"Provides shorter text formatting substitutions."

To say i: say "[italic type]".
To say b: say "[bold type]".
to say f: say "[fixed letter spacing]".
to say v: say "[variable letter spacing]".
to say p: say "[paragraph break]".
to say l: say "[line break]".
to say /: say "[roman type]".
to say lb: say "[bracket]".
to say rb: say "[close bracket]".

Text Abbreviations ends here.

---- DOCUMENTATION ----

This tiny bit of code adds shortcuts for common text formatting to save typing out common formatting such as [bracket]paragraph break[close bracket] hundreds of times. The code goes within brackets inside quotation marks as a text substitution.

i is italic type.

b is bold type.

f is fixed letter spacing. (usually will display as Courier, or the preferred monospace font in an interpreter)

v is variable letter spacing. (normal variable with font, the default)

p is paragraph break

l is line break

/  is roman type (cancel formatting - standard text display)

lb is left bracket (bracket)- "[bracket]"

rb is right bracket (close bracket) - "[close bracket]"

*: "Formatting Test"

   Include Text Abbreviations by Hanon Ondricek
   
   Test Room is a room. "[one of]Type LOOK.[or]You are in the [b]Test Room[/]. It is [i]quite[/] deserted in here except for a screen reading [f]THIS ROOM IS UNIMPLEMENTED[l]-Do not even try to examine this screen-[/].[p][lb]You feel as if you are being [i]watched[/][rb]...[p]Here are your literal formatting codes, because I was too lazy to type 'bracket/close bracket' nine times in a row (yes, I know, [i]copy/paste[/]):[p][lb]i[rb][l][lb]b[rb][l][lb]f[rb][l][lb]v[rb][l][lb]p[rb][l][lb]l[rb][l][lb]/[rb][l][lb]lb[rb][l][lb]rb[rb][l][stopping]"
   
   Test me with "look".


Attachments:
Text Abbreviations.i7x [1.73 KiB]
Downloaded 21 times

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/
Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Text format et. al.
PostPosted: Fri Nov 23, 2018 10:39 am 
Offline

Joined: Sat May 21, 2016 2:48 pm
Posts: 39
Thank you, kindly. How about different colors?


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Text format et. al.
PostPosted: Fri Nov 23, 2018 3:50 pm 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2899
Location: US - Central
HanonO wrote:
Emily Short's "Basic Screen Effects" enables color effects in a Zcode project.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Text format et. al.
PostPosted: Tue Jan 15, 2019 10:57 am 
Offline

Joined: Tue Jan 15, 2019 10:37 am
Posts: 2
HanonO wrote:
HanonO wrote:
Emily Short's "Basic Screen Effects" enables color effects in a Zcode project.

I've pursued that, but how about for GLUX. I'm trying to revise "Bronze" by Emily Short to run under Inform 7 v 6M62 to run in that environment and things like "say white letters" generates a compiler error. BSE explicitly indicates that such features don't work for GLUX, and even Glulx Text Effects doesn't provide a solution.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Text format et. al.
PostPosted: Tue Jan 15, 2019 1:14 pm 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2899
Location: US - Central
I'm not aware of any similar method to control colors in a standard Glulx project. The only thing that comes to mind would be something like Vorple, but that is a hosted solution and I don't believe there's a standalone interpreter that runs it for offline play. I haven't done any in-depth research whether it's possible to bind up a Vorple-game-website as a standalone app.
https://vorple-if.com/

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Text format et. al.
PostPosted: Tue Jan 15, 2019 2:42 pm 
Offline
User avatar

Joined: Fri Jul 11, 2014 12:50 pm
Posts: 132
It is possible to bind a Vorple game into a standalone app. In fact, I wrote an Electron boilerplate to do just that. However, it's not yet documented, and it's not entirely trivial to set up if you're not familiar with JavaScript development.

But if you don't want to mess with Vorple, Glulx Text Effects can do the job, depending on the number of colours you want. You can define two custom styles if you only need two colours. If you need more, you can overwrite other styles if some features are not used in the game (for example, you can use the note style if the game don't have score).

If you need colours in the status bar, I've written an extension that do the same thing as Glulx Text Effects, but for the status bar.

_________________
Maintainer of the Inform 7 French extension


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Text format et. al.
PostPosted: Wed Jan 16, 2019 4:41 pm 
Offline

Joined: Tue Jan 15, 2019 10:37 am
Posts: 2
Thanks for the responses! I'm too new at this to take on another platform! :) I realize that Inform hasn't had a major release in some time, but I sure hope that =someday= it will be enhanced to the point that it supports the full complement of functions contained in Emily Short's "Basic Screen Effects".


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Text format et. al.
PostPosted: Wed Jan 16, 2019 5:09 pm 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2600
There's also the Glk Text Formatting extension: https://github.com/i7/extensions/blob/m ... atting.i7x

Currently only supported in Windows Glk, but will be supported in Gargoyle when it has a new release.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group