427 lines
11 KiB
C
427 lines
11 KiB
C
|
|
#pragma once
|
|||
|
|
|
|||
|
|
extern std::map<uint64_t, ActorPtr>ActorPtrMapObject;
|
|||
|
|
extern std::map<std::string, FontPtr>FontRecObject;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>
|
|||
|
|
static SQInteger Squirrle_Create_Text_Object(HSQUIRRELVM v)
|
|||
|
|
{
|
|||
|
|
SQInteger Top = sq_gettop(v);
|
|||
|
|
if (Top <= 0)
|
|||
|
|
{
|
|||
|
|
sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ɫ
|
|||
|
|
TextActorPtr text = new TextActor();
|
|||
|
|
|
|||
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>UUID
|
|||
|
|
uint64_t UUID = text->GetObjectID();
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Map<61><70><EFBFBD><EFBFBD>
|
|||
|
|
ActorPtrMapObject[UUID] = text;
|
|||
|
|
|
|||
|
|
//<2F><>HshName<6D><65><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
sq_pushinteger(v, UUID);
|
|||
|
|
|
|||
|
|
return 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD>ı<EFBFBD>
|
|||
|
|
static SQInteger Squirrle_Set_Text_Object_Text(HSQUIRRELVM v)
|
|||
|
|
{
|
|||
|
|
SQInteger Top = sq_gettop(v);
|
|||
|
|
if (Top <= 0)
|
|||
|
|
{
|
|||
|
|
sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
SQInteger ActorUUID;
|
|||
|
|
sq_getinteger(v, 2, &ActorUUID);
|
|||
|
|
|
|||
|
|
//<2F>õ<EFBFBD>Squirrel<65>ַ<EFBFBD><D6B7><EFBFBD>
|
|||
|
|
const SQChar* OutPutBuffer;
|
|||
|
|
sq_getstring(v, 3, &OutPutBuffer);
|
|||
|
|
|
|||
|
|
//<2F>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD>New<65><77>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
char* OutPutText = SquirrelClassEx::SquirrelU2W((char*)OutPutBuffer);
|
|||
|
|
|
|||
|
|
//<2F><>ȫ<EFBFBD><C8AB>Map<61>л<EFBFBD>ȡ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ɫ
|
|||
|
|
if (ActorPtrMapObject.count(ActorUUID)) {
|
|||
|
|
TextActorPtr text = dynamic_cast<TextActor*>(ActorPtrMapObject[ActorUUID].Get());
|
|||
|
|
text->SetText(OutPutText);
|
|||
|
|
sq_pushbool(v, true);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
sq_pushbool(v, false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>New<65><77><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
|||
|
|
delete[]OutPutText;
|
|||
|
|
|
|||
|
|
return 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|||
|
|
static SQInteger Squirrle_Set_Text_Object_Color(HSQUIRRELVM v)
|
|||
|
|
{
|
|||
|
|
SQInteger Top = sq_gettop(v);
|
|||
|
|
if (Top <= 0)
|
|||
|
|
{
|
|||
|
|
sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
SQInteger ActorUUID;
|
|||
|
|
sq_getinteger(v, 2, &ActorUUID);
|
|||
|
|
|
|||
|
|
SQInteger TextColor;
|
|||
|
|
sq_getinteger(v, 3, &TextColor);
|
|||
|
|
|
|||
|
|
//<2F><>ȫ<EFBFBD><C8AB>Map<61>л<EFBFBD>ȡ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ɫ
|
|||
|
|
if (ActorPtrMapObject.count(ActorUUID)) {
|
|||
|
|
TextActorPtr text = dynamic_cast<TextActor*>(ActorPtrMapObject[ActorUUID].Get());
|
|||
|
|
text->SetFillColor(TextColor);
|
|||
|
|
sq_pushbool(v, true);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
sq_pushbool(v, false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
|||
|
|
static SQInteger Squirrle_Set_Text_Object_TextStyle(HSQUIRRELVM v)
|
|||
|
|
{
|
|||
|
|
SQInteger Top = sq_gettop(v);
|
|||
|
|
if (Top <= 0)
|
|||
|
|
{
|
|||
|
|
sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
SQInteger ActorUUID;
|
|||
|
|
sq_getinteger(v, 2, &ActorUUID);
|
|||
|
|
|
|||
|
|
//<2F>õ<EFBFBD>Squirrel<65>ַ<EFBFBD><D6B7><EFBFBD> <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>Key
|
|||
|
|
const SQChar* OutPutBuffer;
|
|||
|
|
sq_getstring(v, 3, &OutPutBuffer);
|
|||
|
|
|
|||
|
|
//<2F>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD>New<65><77>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
char* OutPutText = SquirrelClassEx::SquirrelU2W((char*)OutPutBuffer);
|
|||
|
|
std::string FontName = OutPutText;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>New<65><77><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
|||
|
|
delete[]OutPutText;
|
|||
|
|
|
|||
|
|
|
|||
|
|
//ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>崴<EFBFBD><E5B4B4><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ʽ
|
|||
|
|
if (Top == 3) {
|
|||
|
|
//<2F><>ȫ<EFBFBD><C8AB>Map<61>л<EFBFBD>ȡ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ɫ
|
|||
|
|
if (ActorPtrMapObject.count(ActorUUID)) {
|
|||
|
|
TextActorPtr text = dynamic_cast<TextActor*>(ActorPtrMapObject[ActorUUID].Get());
|
|||
|
|
if (FontRecObject.count(FontName)) {
|
|||
|
|
TextStyle TsP = TextStyle(FontRecObject[FontName]);
|
|||
|
|
text->SetStyle(TsP);
|
|||
|
|
}
|
|||
|
|
sq_pushbool(v, true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (Top == 8) {
|
|||
|
|
//<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6>䷽ʽ
|
|||
|
|
SQInteger gTextAlign;
|
|||
|
|
sq_getinteger(v, 4, &gTextAlign);
|
|||
|
|
|
|||
|
|
//<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>п<EFBFBD><D0BF><EFBFBD>
|
|||
|
|
SQFloat gwrap_width;
|
|||
|
|
sq_getfloat(v, 5, &gwrap_width);
|
|||
|
|
|
|||
|
|
//<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD>
|
|||
|
|
SQFloat gline_spacing;
|
|||
|
|
sq_getfloat(v, 6, &gline_spacing);
|
|||
|
|
|
|||
|
|
//<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>»<EFBFBD><C2BB><EFBFBD>
|
|||
|
|
SQBool gshow_underline;
|
|||
|
|
sq_getbool(v, 7, &gshow_underline);
|
|||
|
|
|
|||
|
|
//<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾɾ<CABE><C9BE><EFBFBD><EFBFBD>
|
|||
|
|
SQBool gshow_strikethrough;
|
|||
|
|
sq_getbool(v, 8, &gshow_strikethrough);
|
|||
|
|
|
|||
|
|
//<2F><>ȫ<EFBFBD><C8AB>Map<61>л<EFBFBD>ȡ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ɫ
|
|||
|
|
if (ActorPtrMapObject.count(ActorUUID)) {
|
|||
|
|
TextActorPtr text = dynamic_cast<TextActor*>(ActorPtrMapObject[ActorUUID].Get());
|
|||
|
|
if (FontRecObject.count(FontName)) {
|
|||
|
|
TextStyle TsP = TextStyle(FontRecObject[FontName]);
|
|||
|
|
switch (gTextAlign)
|
|||
|
|
{
|
|||
|
|
case 0:
|
|||
|
|
TsP.alignment = TextAlign::Left;
|
|||
|
|
break;
|
|||
|
|
case 1:
|
|||
|
|
TsP.alignment = TextAlign::Right;
|
|||
|
|
break;
|
|||
|
|
case 2:
|
|||
|
|
TsP.alignment = TextAlign::Center;
|
|||
|
|
break;
|
|||
|
|
case 3:
|
|||
|
|
TsP.alignment = TextAlign::Justified;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
TsP.wrap_width = gwrap_width;
|
|||
|
|
TsP.line_spacing = gline_spacing;
|
|||
|
|
TsP.show_underline = gshow_underline;
|
|||
|
|
TsP.show_strikethrough = gshow_strikethrough;
|
|||
|
|
text->SetStyle(TsP);
|
|||
|
|
}
|
|||
|
|
sq_pushbool(v, true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
sq_pushbool(v, false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
return 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6>䷽ʽ
|
|||
|
|
static SQInteger Squirrle_Set_Text_Object_Alignment(HSQUIRRELVM v)
|
|||
|
|
{
|
|||
|
|
SQInteger Top = sq_gettop(v);
|
|||
|
|
if (Top <= 0)
|
|||
|
|
{
|
|||
|
|
sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
SQInteger ActorUUID;
|
|||
|
|
sq_getinteger(v, 2, &ActorUUID);
|
|||
|
|
|
|||
|
|
SQInteger TextAlignment;
|
|||
|
|
sq_getinteger(v, 3, &TextAlignment);
|
|||
|
|
|
|||
|
|
//<2F><>ȫ<EFBFBD><C8AB>Map<61>л<EFBFBD>ȡ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ɫ
|
|||
|
|
if (ActorPtrMapObject.count(ActorUUID)) {
|
|||
|
|
TextActorPtr text = dynamic_cast<TextActor*>(ActorPtrMapObject[ActorUUID].Get());
|
|||
|
|
switch (TextAlignment)
|
|||
|
|
{
|
|||
|
|
case 0:
|
|||
|
|
text->SetAlignment(TextAlign::Left);
|
|||
|
|
break;
|
|||
|
|
case 1:
|
|||
|
|
text->SetAlignment(TextAlign::Right);
|
|||
|
|
break;
|
|||
|
|
case 2:
|
|||
|
|
text->SetAlignment(TextAlign::Center);
|
|||
|
|
break;
|
|||
|
|
case 3:
|
|||
|
|
text->SetAlignment(TextAlign::Justified);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
sq_pushbool(v, true);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
sq_pushbool(v, false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
static SQInteger Squirrle_Set_Text_Object_Outline(HSQUIRRELVM v)
|
|||
|
|
{
|
|||
|
|
SQInteger Top = sq_gettop(v);
|
|||
|
|
if (Top <= 0)
|
|||
|
|
{
|
|||
|
|
sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
SQInteger ActorUUID;
|
|||
|
|
sq_getinteger(v, 2, &ActorUUID);
|
|||
|
|
|
|||
|
|
SQInteger OutlineStyle;
|
|||
|
|
sq_getinteger(v, 3, &OutlineStyle);
|
|||
|
|
|
|||
|
|
SQInteger OutlineColor;
|
|||
|
|
sq_getinteger(v, 4, &OutlineColor);
|
|||
|
|
|
|||
|
|
//<2F><>ȫ<EFBFBD><C8AB>Map<61>л<EFBFBD>ȡ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ɫ
|
|||
|
|
if (ActorPtrMapObject.count(ActorUUID)) {
|
|||
|
|
TextActorPtr text = dynamic_cast<TextActor*>(ActorPtrMapObject[ActorUUID].Get());
|
|||
|
|
StrokeStylePtr SSP = new StrokeStyle(2);
|
|||
|
|
switch (OutlineStyle)
|
|||
|
|
{
|
|||
|
|
case 0 :
|
|||
|
|
SSP->SetWidth(3.0);
|
|||
|
|
//SSP->SetCapStyle(CapStyle::Flat);
|
|||
|
|
//SSP->SetLineJoinStyle(LineJoinStyle::Miter);
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
text->SetOutlineStrokeStyle(SSP);
|
|||
|
|
text->SetOutlineColor(OutlineColor);
|
|||
|
|
|
|||
|
|
sq_pushbool(v, true);
|
|||
|
|
|
|||
|
|
|
|||
|
|
//TextStyle OldT = text->GetStyle();
|
|||
|
|
//std::string TString = text->GetText();
|
|||
|
|
|
|||
|
|
//TextActorPtr LeftUp = new TextActor(TString, OldT);
|
|||
|
|
//LeftUp->SetPosition(-1.0, -1.0);
|
|||
|
|
//LeftUp->SetFillColor(0xff000000);
|
|||
|
|
//LeftUp->SetZOrder(-1);
|
|||
|
|
//text->AddChild(LeftUp);
|
|||
|
|
//
|
|||
|
|
//TextActorPtr Left = new TextActor(TString, OldT);
|
|||
|
|
//Left->SetPosition(-1.0, 0);
|
|||
|
|
//Left->SetFillColor(0xff000000);
|
|||
|
|
//Left->SetZOrder(-1);
|
|||
|
|
//text->AddChild(Left);
|
|||
|
|
|
|||
|
|
//TextActorPtr LeftDown = new TextActor(TString, OldT);
|
|||
|
|
//LeftDown->SetPosition(-1.0, 1.0);
|
|||
|
|
//LeftDown->SetFillColor(0xff000000);
|
|||
|
|
//LeftDown->SetZOrder(-1);
|
|||
|
|
//text->AddChild(LeftDown);
|
|||
|
|
|
|||
|
|
//TextActorPtr Up = new TextActor(TString, OldT);
|
|||
|
|
//Up->SetPosition(0.0, -1.0);
|
|||
|
|
//Up->SetFillColor(0xff000000);
|
|||
|
|
//Up->SetZOrder(-1);
|
|||
|
|
//text->AddChild(Up);
|
|||
|
|
|
|||
|
|
//TextActorPtr Down = new TextActor(TString, OldT);
|
|||
|
|
//Down->SetPosition(0.0, 1.0);
|
|||
|
|
//Down->SetFillColor(0xff000000);
|
|||
|
|
//Down->SetZOrder(-1);
|
|||
|
|
//text->AddChild(Down);
|
|||
|
|
|
|||
|
|
//TextActorPtr RightUp = new TextActor(TString, OldT);
|
|||
|
|
//RightUp->SetPosition(1.0, -1.0);
|
|||
|
|
//RightUp->SetFillColor(0xff000000);
|
|||
|
|
//RightUp->SetZOrder(-1);
|
|||
|
|
//text->AddChild(RightUp);
|
|||
|
|
|
|||
|
|
//TextActorPtr Right = new TextActor(TString, OldT);
|
|||
|
|
//Right->SetPosition(1.0, 0.0);
|
|||
|
|
//Right->SetFillColor(0xff000000);
|
|||
|
|
//Right->SetZOrder(-1);
|
|||
|
|
//text->AddChild(Right);
|
|||
|
|
|
|||
|
|
//TextActorPtr RightDown = new TextActor(TString, OldT);
|
|||
|
|
//RightDown->SetPosition(1.0, 1.0);
|
|||
|
|
//RightDown->SetFillColor(0xff000000);
|
|||
|
|
//RightDown->SetZOrder(-1);
|
|||
|
|
//text->AddChild(RightDown);
|
|||
|
|
|
|||
|
|
//sq_pushbool(v, true);
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
sq_pushbool(v, false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//<2F>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
|||
|
|
static SQInteger Squirrle_Create_Font(HSQUIRRELVM v)
|
|||
|
|
{
|
|||
|
|
SQInteger Top = sq_gettop(v);
|
|||
|
|
if (Top <= 0)
|
|||
|
|
{
|
|||
|
|
sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>õ<EFBFBD>Squirrel<65>ַ<EFBFBD><D6B7><EFBFBD> <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>Key
|
|||
|
|
const SQChar* gFontName;
|
|||
|
|
sq_getstring(v, 2, &gFontName);
|
|||
|
|
|
|||
|
|
//<2F>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD>New<65><77>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
char* FontNamebuf = SquirrelClassEx::SquirrelU2W((char*)gFontName);
|
|||
|
|
std::string FontName = FontNamebuf;
|
|||
|
|
delete[]FontNamebuf;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>岻<EFBFBD><E5B2BB><EFBFBD>ھ<EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if (!FontRecObject.count(FontName)) {
|
|||
|
|
//<2F>õ<EFBFBD>Squirrel<65>ַ<EFBFBD><D6B7><EFBFBD> <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>Key
|
|||
|
|
const SQChar* OutPutBuffer;
|
|||
|
|
sq_getstring(v, 3, &OutPutBuffer);
|
|||
|
|
|
|||
|
|
//<2F>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD>New<65><77>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
char* gFontPath = SquirrelClassEx::SquirrelU2W((char*)OutPutBuffer);
|
|||
|
|
std::string FontPath = gFontPath;
|
|||
|
|
delete[]gFontPath;
|
|||
|
|
|
|||
|
|
SQFloat gfont_size;
|
|||
|
|
sq_getfloat(v, 4, &gfont_size);
|
|||
|
|
|
|||
|
|
|
|||
|
|
FontPtr FontBuf = new Font(FontPath, gfont_size,400U,FontPosture::Normal,FontStretch::Normal);
|
|||
|
|
|
|||
|
|
FontRecObject[FontName] = FontBuf;
|
|||
|
|
sq_pushbool(v, true);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
sq_pushbool(v, false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void R_Register_Nut_Text() {
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
SquirrelClassEx::RegisterNutApi(_SST("sq_Create_Text_Object"), Squirrle_Create_Text_Object, v);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>
|
|||
|
|
SquirrelClassEx::RegisterNutApi(_SST("sq_Set_Text_Object_Text"), Squirrle_Set_Text_Object_Text, v);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD>ı<EFBFBD>
|
|||
|
|
SquirrelClassEx::RegisterNutApi(_SST("sq_Set_Text_Object_Color"), Squirrle_Set_Text_Object_Color, v);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|||
|
|
SquirrelClassEx::RegisterNutApi(_SST("sq_Set_Text_Object_TextStyle"), Squirrle_Set_Text_Object_TextStyle, v);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʽ
|
|||
|
|
SquirrelClassEx::RegisterNutApi(_SST("sq_Set_Text_Object_Alignment"), Squirrle_Set_Text_Object_Alignment, v);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6>䷽ʽ
|
|||
|
|
SquirrelClassEx::RegisterNutApi(_SST("sq_Set_Text_Object_Outline"), Squirrle_Set_Text_Object_Outline, v);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
SquirrelClassEx::RegisterNutApi(_SST("sq_Create_Font"), Squirrle_Create_Font, v);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
}
|