Position of text
Is there a way to edit how far above the deaph-dot of characters their say()-command should write the text? Without editing the source code, that is?
You can use say_xy/say_stop_xy. Though that way's a little annoying when trying to find the right points.
Hmm..yeah...I'd have to check the x and y of the sprite(s) before every conversation.. :/
I guess I'll just set the depth-dot lower... Thanks anyway
I guess I'll just set the depth-dot lower... Thanks anyway
If you're going to change the depth dot make sure you do it for all frames.
You can also record the sprite number of the said text and move it later:
Note that I'm not used to writing "raw" DinkC, so my code may not work, but I hope you get the idea.
int &spr = say ("text", &sprite); int &y = sp_y (&spr, -1); &y += 10; sp_y (&spr, &y);
Note that I'm not used to writing "raw" DinkC, so my code may not work, but I hope you get the idea.
Actually, I think (though I am just getting back into scripting) that it'd work just as you put it there. Since the text is a sprite, you can just tell the script to move its location like any other sprite.
Unfortunately, I don't think that works. The text sprite realigns itself constantly (to stay on top of moving sprites, I assume), so although the text might flicker for some milliseconds, it doesn't stay at the new coordinate.
Oh, but there's a trick for that, too. The sp_strength() and sp_defense() attributes of a text sprite control the x and y offset of the text relative to the depth dot of its "parent". I forgot which of the two is x, and which is y, but pretty sure it's in dinkc.chm, on the sp_strength() and sp_defense() pages.
Alternatively, first say() an empty text, or just spaces, then get its sp_x() and sp_y(), then say_[stop_]xy() all following lines at whatever coordinates. Maybe that works.
Alternatively, first say() an empty text, or just spaces, then get its sp_x() and sp_y(), then say_[stop_]xy() all following lines at whatever coordinates. Maybe that works.
Oh, awesome. I remember reading that, but totally forgot about it.
Alternatively, first say() an empty text, or just spaces, then get its sp_x() and sp_y(), then say_[stop_]xy() all following lines at whatever coordinates. Maybe that works.
That works. E.g.
Alternatively, first say() an empty text, or just spaces, then get its sp_x() and sp_y(), then say_[stop_]xy() all following lines at whatever coordinates. Maybe that works.
That works. E.g.
void talk int &mesay = say("`%<- Pub",¤t_sprite) int &mex = sp_x(&mesay,-1) int &mey = sp_y(&mesay,-1) &mex -= 235 &mey += 20 say_xy("`%-> Inn",&mex,&mey) void hit say("I want hanging signs!",1) }