Hmmm -- I probably didn't explain the problem very well. :) I figured out about the difference in the fixed versus proportional fonts, but what I'm seeing seems to be a failure of the command ">" prompt to actually add the space it takes up to display.cursor_row.
What makes me think this is the following.
I can locate 1,1
display.cursor_row is now 1.
I can print 2 lines of text, without preventing line-wrap:
print "This is a test"
print "This is another test"
display.cursor_row is now 3.
Up to that point, everything is correct.
Now, control returns to the parser, and the ">" prompt appears.
From this point on -- until the text reaches the bottom of the screen -- display.cursor_row is one off. It might be the prompt causing it, or it might be the blank row before the prompt. I'm not sure. But I wrote a little program to demonstrate what I mean.
When you run the program, first type:
SCORE
Then type:
SAVE
Then type it again:
SAVE
and again:
SAVE
You can see that the prompt isn't being included in display.cursor_row. Each time you do it, until you reach the bottom of the screen, the numbers will be 1 higher than they're supposed to be -- for each prompt. And the font size doesn't matter. You can have a tiny fixed font, and a large prop font. The value of display.cursor_row is always correct, except where a command prompt is shown. And then it's one off, for each prompt.
Hope that helps! It's a really weird thing.
---- Mike.
Code: Select all
#include "verblib.g"
#include "hugolib.h"
#include "resource.h"
#include "window.h"
#include "hugolib.h"
!------------------------------------------
routine init
{
counter = -1
player = you
location = TestRoom
move player to location
FindLight(location)
!location is visited
DEFAULT_FONT = PROP_ON
Font(DEFAULT_FONT | PROP_ON)
STATUSTYPE = 0
prompt = ">" ! prompt cursor
cls
}
!------------------------------------------
routine main
{
counter = counter + 1
PrintStatusLine
run location.each_turn
runevents
RunScripts
if parent(speaking)~=location
speaking = 0
}
!------------------------------------------
room Testroom "Test Room"
{
long_desc { "Blah blah." }
}
!------------------------------------------
player_character you "You"
{
long_desc { "Yeah, you're you." }
}
!------------------------------------------
replace doScore
{
cls
locate 1,1
print "This is line #"; number display.cursor_row
print "This is line #"; number display.cursor_row
}
!------------------------------------------
replace doSave
{
print "This is line #"; number display.cursor_row
print "This is line #"; number display.cursor_row
}
Hmmm -- I probably didn't explain the problem very well. :) I figured out about the difference in the fixed versus proportional fonts, but what I'm seeing seems to be a failure of the command ">" prompt to actually add the space it takes up to display.cursor_row.
What makes me think this is the following.
I can locate 1,1
display.cursor_row is now 1.
I can print 2 lines of text, without preventing line-wrap:
print "This is a test"
print "This is another test"
display.cursor_row is now 3.
Up to that point, everything is correct.
Now, control returns to the parser, and the ">" prompt appears.
From this point on -- until the text reaches the bottom of the screen -- display.cursor_row is one off. It might be the prompt causing it, or it might be the blank row before the prompt. I'm not sure. But I wrote a little program to demonstrate what I mean.
When you run the program, first type:
SCORE
Then type:
SAVE
Then type it again:
SAVE
and again:
SAVE
You can see that the prompt isn't being included in display.cursor_row. Each time you do it, until you reach the bottom of the screen, the numbers will be 1 higher than they're supposed to be -- for each prompt. And the font size doesn't matter. You can have a tiny fixed font, and a large prop font. The value of display.cursor_row is always correct, except where a command prompt is shown. And then it's one off, for each prompt.
Hope that helps! It's a really weird thing.
---- Mike.
[code]#include "verblib.g"
#include "hugolib.h"
#include "resource.h"
#include "window.h"
#include "hugolib.h"
!------------------------------------------
routine init
{
counter = -1
player = you
location = TestRoom
move player to location
FindLight(location)
!location is visited
DEFAULT_FONT = PROP_ON
Font(DEFAULT_FONT | PROP_ON)
STATUSTYPE = 0
prompt = ">" ! prompt cursor
cls
}
!------------------------------------------
routine main
{
counter = counter + 1
PrintStatusLine
run location.each_turn
runevents
RunScripts
if parent(speaking)~=location
speaking = 0
}
!------------------------------------------
room Testroom "Test Room"
{
long_desc { "Blah blah." }
}
!------------------------------------------
player_character you "You"
{
long_desc { "Yeah, you're you." }
}
!------------------------------------------
replace doScore
{
cls
locate 1,1
print "This is line #"; number display.cursor_row
print "This is line #"; number display.cursor_row
}
!------------------------------------------
replace doSave
{
print "This is line #"; number display.cursor_row
print "This is line #"; number display.cursor_row
}[/code]