-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextf.dnh
63 lines (62 loc) · 1.25 KB
/
textf.dnh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// text object utilities because I'm lazy
function gt {
return GetCommonData("cto", ID_INVALID);
}
function cta(s) {
return ct(s, 100, 1000);
}
function ct(s, wc, wp) {
let t = ObjText_Create;
if (useUruwi) {ObjText_SetTextWW(t, s, wc);}
else {
ObjText_SetMaxWidth(t, wp);
ObjText_SetText(t, s);
}
Obj_SetValue(t, "wc", wc);
Obj_SetValue(t, "wp", wp);
st(t);
return t;
}
function st(t) {
SetCommonData("cto", t);
}
function txs(s) {
if (useUruwi) {ObjText_SetTextWW(gt, s, Obj_GetValue(gt, "wc"));}
else {
ObjText_SetText(gt, s);
}
}
function txl(k) {
txs(S(k));
}
function txp(x, y) {
ObjRender_SetPosition(gt, x, y, 0);
}
function txct(r, g, b) {
ObjText_SetFontColorTop(gt, r, g, b);
}
function txcb(r, g, b) {
ObjText_SetFontColorBottom(gt, r, g, b);
}
function txc(r, g, b) {
txct(r, g, b);
txcb(r, g, b);
}
function txb(r, g, b) {
ObjText_SetFontBorderColor(gt, r, g, b);
ObjText_SetFontBorderType(gt, BORDER_FULL);
ObjText_SetFontBorderWidth(gt, 2);
}
function txh(h) {
ObjText_SetFontSize(gt, h);
}
function txt(t) {
ObjText_SetFontType(gt, S("font." ~ t));
}
function txr(r) {
Obj_SetRenderPriorityI(gt, r);
}
function txalign(maxWidth, alignment) {
ObjText_SetMaxWidth(gt, maxWidth);
ObjText_SetHorizontalAlignment(gt, alignment);
}