Text Adventure in Rev?

Alex Tweedly alex at tweedly.net
Mon Oct 24 10:39:57 EDT 2005


Philip Richmond wrote:

>Hello,
>
>I'm new here and just downloaded the trial of
>Revolution + some tutorials from the main site.
>  
>
Welcome. You've found a good place :-)

>The player would input a command into a one line text
>field and then after processing/parsing the game text
>would be output to a multiline textbox with a scroll.
>I kind of envision it working pretty much the same in
>Rev.
>  
>
That sounds easily do-able.

>I've worked out how to put text after existing text in
>such an object but what I need to know is how do I
>check that the text to be output/shown does not exceed
>the maxnum of lines in the viewable area of the text
>control? For instance if 20 lines are viewable and 36
>lines of text are set to be put there how can I
>display the max of 20 lines, print a message like 
>"Press Any Key To Continue" and after the player makes
>a keypress then show the remaining 16 lines of text
>before asking for another player input?? Anyone ever
>tried this or got any ideas on how to fathom it? Is it
>going to be difficult or can it be done fairly easily?
>I would welcome any advice or pointers to a solution.
>
>  
>
Advice: don't do it that way. Make it a scrollable text field, put your 
36 lines into it, leave it positioned so the top of the field is visible 
- and then let the user scroll the field to read the rest of it when she 
is ready. The scrollbar will make it clear there is more there to be 
read - and nowadays everyone is familiar with scrollbars, and can choose 
the means they prefer (arrow key vs. page-down key vs click in scroll 
area vs scroll wheel vs ....) to scroll as they wish.

Pointer to a solution: check in the docs for "formattedHeight"
Note you can do something like
     get the formattedHeight of line 1 to 16 of field "OutputText".

But use the advice not the pointer :-) :-)

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.361 / Virus Database: 267.12.5/147 - Release Date: 24/10/2005




More information about the use-livecode mailing list