Активный текст - с его помощью можно делать RPG миссии,систему торговли,диалоги,скилл,прокачку.В его нетрудно освоить,но труднее понять.Я более-менее разобрался с этим,но у меня есть вопрос,который давно бьёт меня об стенку головой.Можно ли как то,создав квадратное окно,округлить его?Вот пример,я хочу сделать что то вроди плеера,который можно вызывать по рации(доработаю до совершенства).Мне надо округить его,пока что на нём тока игровые трэки,ну вот вообщем:
файл Description.ext
#define FontM "tahomaB36"
#define FontHTML "CourierNewB64"
#define ST_LEFT 0
#define ST_RIGHT 1
#define ST_CENTER 2
#define ST_FRAME 64
#define CT_STATIC 0
#define CT_BUTTON 1
#define CT_EDIT 2
#define CT_COMBO 4
#define CT_LISTBOX 5
#define CT_ACTIVETEXT 11
class RscText
{
type = CT_STATIC;
idc = -1;
style = ST_LEFT;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
font = FontM;
sizeEx = 0.04;
};
class RscActiveText
{
type = CT_ACTIVETEXT;
idc = -1;
style = ST_LEFT;
color[] = {1, 1, 1, 1};
colorActive[] = {1, 0, 0, 1};
font = FontM;
sizeEx = 0.04;
soundEnter[] = {"ui\ui_over", 0.2, 1};
soundPush[] = {, 0.2, 1};
soundClick[] = {"ui\ui_ok", 0.2, 1};
soundEscape[] = {"ui\ui_cc", 0.2, 1};
default = false;
};
class RscButton
{
type = CT_BUTTON;
idc = -1;
style = ST_CENTER;
colorText[] = {0, 0, 0, 1};
font = FontHTML;
sizeEx = 0.025;
soundPush[] = {, 0.2, 1};
soundClick[] = {"ui\ui_ok", 0.2, 1};
soundEscape[] = {"ui\ui_cc", 0.2, 1};
default = false;
};
class RscEdit
{
type = CT_EDIT;
idc = -1;
style = ST_LEFT;
font = FontHTML;
sizeEx = 0.02;
colorText[] = {0, 0, 0, 1};
colorSelection[] = {0.5, 0.5, 0.5, 1};
autocomplete = false;
text = ;
};
class RscLB_C
{
style = ST_LEFT;
idc = -1;
colorSelect[] = {0.4, 0.4, 0.4, 1};
colorSelectBackground[] = {0.2, 0.2, 0.2, 1};
colorText[] = {0.2, 0.2, 0.2, 1};
colorBackground[] = {0.4, 0.4, 0.4, 1};
font = FontHTML;
sizeEx = 0.025;
rowHeight = 0.04;
};
class RscListBox : RscLB_C
{
type = CT_LISTBOX;
};
class RscCombo : RscLB_C
{
type = CT_COMBO;
wholeHeight = 0.3;
};
class DlgTutorial
{
idd = -1;
movingEnable = true;
controlsBackground[] = { MY_BACKGROUND, MY_FRAME };
class MY_BACKGROUND : RscText
{
colorBackground[] = {0.4, 0.4, 0.4, 0.75};
text = ;
x = 0.01;
y = 0.63;
w = 0.5;
h = 0.35;
};
class MY_FRAME : RscText
{
idc = 103;
style = ST_FRAME;
colorText[] = {0, 0, 0, 1};
text = "Музыка на плеере";
font = FontHTML;
sizeEx = 0.025;
x = 0.01;
y = 0.63;
w = 0.5;
h = 0.35;
};
objects[] = { };
controls[] = { HELLO_WORLD, MY_BUTTON, MY_LIST, MY_BUTTON2, MY_BUTTON3};
class HELLO_WORLD : RscText
{
idc = 100;
style = ST_CENTER;
x = 0.06;
y = 0.46;
w = 0.5;
h = 0.4;
text = "аудиотрэк";
};
class MY_BUTTON : RscButton
{
idc = 102;
x = 0.3;
y = 0.7;
w = 0.12;
h = 0.04;
text = "Включить";
action = "[] exec ""play.sqs""";
};
class MY_BUTTON2 : RscButton
{
idc = 101;
x = 0.3;
y = 0.75;
w = 0.1;
h = 0.04;
text = "Стоп";
action = "[] exec ""stop.sqs""";
};
class MY_BUTTON3 : RscButton
{
idc = 103;
x = 0.2;
y = 0.9;
w = 0.1;
h = 0.04;
text = "Выход";
action ="closeDialog 0";
};
class MY_LIST : RscCombo
{
idc = 104;
x = 0.03;
y = 0.7;
w = 0.15;
h = 0.04;
};
};
class CfgMusic
{
tracks[]=
{
};
class stop
{
name = "stop";
sound[] = {stop.ogg, db+0, 1.0};
};
};
скрипт play.sqs
ctrlSetText [100, lbData[104, lbCurSel 104]]
_music=LbValue[104, (lbcursel 104)]
?(_music==1):playmusic "Track1"
?(_music==2):playmusic "Track2"
?(_music==3):playmusic "Track3"
?(_music==4):playmusic "Track4"
?(_music==5):playmusic "Track5"
?(_music==6):playmusic "Track6"
?(_music==7):playmusic "Track7"
?(_music==8):playmusic "Track8"
?(_music==9):playmusic "Track9"
?(_music==10):playmusic "Track10"
?(_music==11):playmusic "Track11"
?(_music==12):playmusic "Track12"
?(_music==13):playmusic "Track13"
?(_music==14):playmusic "Track14"
?(_music==15):playmusic "Track15"
?(_music==16):playmusic "Track16"
?(_music==17):playmusic "7thdecide"
?(_music==18):playmusic "7thiamgonafly"
?(_music==19):playmusic "7thlifeless"
?(_music==20):playmusic "7thoverdose"
?(_music==21):playmusic "Rtrack1a"
?(_music==22):playmusic "Rtrack1b"
?(_music==23):playmusic "Rtrack2"
?(_music==24):playmusic "Rtrack3"
?(_music==25):playmusic "Rtrack4"
?(_music==26):playmusic "Rtrack5"
?(_music==27):playmusic "Rtrack6"
?(_music==28):playmusic "Rtrack7"
?(_music==29):playmusic "Rtrack8"
?(_music==30):playmusic "Rtrack9"
?(_music==31):playmusic "Rtrack10"
?(_music==32):playmusic "7thmylife"
?(_music==33):playmusic "7thDarken"
скрипт stop.sqs
playmusic "stop"
скрипт createDialog.sqs
_ok = createDialog "DlgTutorial"
?(!_ok): hint "Error!"; exit
_index = lbAdd [104, "Track 1"]
lbSetData [104, _index, "Track1"]
lbSetValue [104, _index, 1]
_index = lbAdd [104, "Track 2"]
lbSetData [104, _index, "Track2"]
lbSetValue [104, _index, 2]
_index = lbAdd [104, "Track 3"]
lbSetData [104, _index, "Track3"]
lbSetValue [104, _index, 3]
_index = lbAdd [104, "Track 4"]
lbSetData [104, _index, "Track 4"]
lbSetValue [104, _index, 4]
_index = lbAdd [104, "Track 5"]
lbSetData [104, _index, "Track5"]
lbSetValue [104, _index, 5]
lbSetCurSel [104, 0]
_index = lbAdd [104, "Track 6"]
lbSetData [104, _index, "Track 6"]
lbSetValue [104, _index, 6]
_index = lbAdd [104, "Track 7"]
lbSetData [104, _index, "Track7"]
lbSetValue [104, _index, 7]
_index = lbAdd [104, "Track 8"]
lbSetData [104, _index, "Track 8"]
lbSetValue [104, _index, 8]
_index = lbAdd [104, "Track 9"]
lbSetData [104, _index, "Track 9"]
lbSetValue [104, _index, 9]
_index = lbAdd [104, "Track 10"]
lbSetData [104, _index, "Track 10"]
lbSetValue [104, _index, 10]
lbSetCurSel [104, 0]
_index = lbAdd [104, "Track 11"]
lbSetData [104, _index, "Track11"]
lbSetValue [104, _index, 11]
_index = lbAdd [104, "Track 12"]
lbSetData [104, _index, "Track12"]
lbSetValue [104, _index, 12]
_index = lbAdd [104, "Track 13"]
lbSetData [104, _index, "Track13"]
lbSetValue [104, _index, 13]
_index = lbAdd [104, "Track 14"]
lbSetData [104, _index, "Track 14"]
lbSetValue [104, _index, 14]
_index = lbAdd [104, "Track 15"]
lbSetData [104, _index, "Track15"]
lbSetValue [104, _index, 15]
lbSetCurSel [104, 0]
_index = lbAdd [104, "Track 16"]
lbSetData [104, _index, "Track 16"]
lbSetValue [104, _index, 16]
_index = lbAdd [104, "7thdecide"]
lbSetData [104, _index, "7thdecide"]
lbSetValue [104, _index, 17]
_index = lbAdd [104, "7thiamgonafly"]
lbSetData [104, _index, "7thiamgonafly"]
lbSetValue [104, _index, 18]
_index = lbAdd [104, "7thlifeless"]
lbSetData [104, _index, "7thlifeless"]
lbSetValue [104, _index, 19]
_index = lbAdd [104, "7thoverdose"]
lbSetData [104, _index, "7thoverdose"]
lbSetValue [104, _index, 20]
_index = lbAdd [104, "Rtrack1a"]
lbSetData [104, _index, "Rtrack1a"]
lbSetValue [104, _index, 21]
_index = lbAdd [104, "Rtrack1b"]
lbSetData [104, _index, "Rtrack1b"]
lbSetValue [104, _index, 22]
_index = lbAdd [104, "Rtrack2"]
lbSetData [104, _index, "Rtrack2"]
lbSetValue [104, _index, 23]
_index = lbAdd [104, "Rtrack3"]
lbSetData [104, _index, "Rtrack3"]
lbSetValue [104, _index, 24]
_index = lbAdd [104, "Rtrack4"]
lbSetData [104, _index, "Rtrack4"]
lbSetValue [104, _index, 25]
_index = lbAdd [104, "Rtrack5"]
lbSetData [104, _index, "Rtrack5"]
lbSetValue [104, _index, 26]
_index = lbAdd [104, "Rtrack6"]
lbSetData [104, _index, "Rtrack6"]
lbSetValue [104, _index, 27]
_index = lbAdd [104, "Rtrack7"]
lbSetData [104, _index, "Rtrack7"]
lbSetValue [104, _index, 28]
_index = lbAdd [104, "Rtrack8"]
lbSetData [104, _index, "Rtrack8"]
lbSetValue [104, _index, 29]
_index = lbAdd [104, "Rtrack9"]
lbSetData [104, _index, "Rtrack9"]
lbSetValue [104, _index, 30]
_index = lbAdd [104, "Rtrack10"]
lbSetData [104, _index, "Rtrack10"]
lbSetValue [104, _index, 31]
_index = lbAdd [104, "7thmylife"]
lbSetData [104, _index, "7thmylife"]
lbSetValue [104, _index, 32]
_index = lbAdd [104, "7thDarken"]
lbSetData [104, _index, "7thDarken"]
lbSetValue [104, _index, 33]
Я выкладываю туть всё,дабы вы всё поняли правильно.Вызвав по рации в нижней левой части экрана появляетсо окошко с выбором всех трэков,доступных в игре.Моя проблема простая,как округлить этот квадрат?Какие компоненты надо добавить?Можит кито разбирается?Если да то подскажите,если нет,то используйте на здоровье)
Кстати,JTS мне выложить туториал по активу?Елси да то куда?в эту тему или в Hints & Tips?
Отредактировано Роберт (2009-12-16 23:51:41)