26 Nov 10, 12:27AM
I was thinking about the recently included tutorial made by Gibstick and DES|Bukz, and I thought about how nice it would be to allow their text to be displayed in a fashion not unlike the "!TEST BUILD!" that one might see when testing SVN. I thought I would just transcribe their tutorial into C++, then I figured, why not just include some cubescript support? So I got to coding.
This is what I came up with (so far):
With display_cs_text hidden away in gl_drawhud.
This allows the user to change the text location, and what the text says. Now, I do see some problems with including this, with such a huge range of values for the location, but I figured I'd get that smoothed out once I finish it.
This is what I ended up with:
I was wondering what the devs thought of this (currently) 8 lines of C++ being include in AC? I am also wondering what other people think I can improve in these lines. I know the ranges aren't perfect, but that will come later.
This is what I came up with (so far):
[SELECT ALL] Code:
VARP(displayed_text_y, 0, 10, 2500);
VARP(displayed_text_x, 0, 10, 2500);
void display_cs_text ()
{
draw_textf("%s", displayed_text_x, displayed_text_y, getalias("displayed_text"));
}
This allows the user to change the text location, and what the text says. Now, I do see some problems with including this, with such a huge range of values for the location, but I figured I'd get that smoothed out once I finish it.
This is what I ended up with:
I was wondering what the devs thought of this (currently) 8 lines of C++ being include in AC? I am also wondering what other people think I can improve in these lines. I know the ranges aren't perfect, but that will come later.