home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2003 August
/
VPR0308.ISO
/
WAKABA
/
4koma.tfy
< prev
next >
Wrap
Text File
|
2000-04-30
|
6KB
|
218 lines
#info INAM "わかばちゃん・びゅーわー"
#info IART "POCOPEN,GGB02243@niftyserve.or.jp;poco@yun.co.jp"
#info ICOP "POCOPEN,GGB02243@niftyserve.or.jp;poco@yun.co.jp"
int sClick;
int pic[],basePic;
int zoomPic;
int mainWin,zoomWin;
int picW,picH,picH0;
int sc,zoom;
int koma,title;
str file[];
int bgms;
str bgm;
str LF;
str name;
main(){
int backPic;
int cast,i;
LF=StrCode(0x0a);
loadIni();
sc=1;
sClick=LoadRsc("CLICK.WAV");
if(WinInfo(1)<768)sc=2;
loadPic();
playBGM();
picW=PicWidth(pic[1]);
picH=PicHeight(pic[1]);
if(title!=0)makeTitle();
picH0=PicHeight(pic[0]);
backPic=CreatePic(pic[0],picW,picH0+picH);
MoveSPic(pic[0],0,0,picW,picH0,backPic,0,0,picW,picH0);
basePic=CreatePic(backPic);
PutCast(backPic,basePic);
cast=PutCast(pic[1],basePic,0,picH0);
putLink();
CapTitle(name);
mainWin=OpenWin(basePic);
showHelp();
i=1;
mes(KEY_DOWN){
if(StrCode(MesP2)=="H"){
showHelp();
}
else{
step{
zoom=1;
zoomin();
,
zoom=0;
zoomin();
}
}
}
mes(RBDBLCLK){
exit();
}
mes(LBDOWN){
if(zoom==0&&MesP3>picH0){
i=i+1;
if(i==koma+2){
exit();
i=i-1;
}
if(i==koma+1)lastMes();
else MoveCast(cast,pic[i],0,picH0);
PlayRsc(sClick);
}
}
mes(RBDOWN){
if(zoom==0&&MesP3>picH0){
i=i-1;
if(i==0){
exit();
i=i+1;
}
else MoveCast(cast,pic[i],0,picH0);
PlayRsc(sClick);
}
}
}
int loadPic(){
int i,pic_;
int picW_,picH_;
for(i=title;i<=koma;i=i+1){
pic_=LoadPic(file[i]);
picW_=PicWidth(pic_);
picH_=PicHeight(pic_);
pic[i]=CreatePic(pic_,picW_/sc,picH_/sc);
MoveSPic(pic_,0,0,picW_,picH_,pic[i],0,0,picW_/sc,picH_/sc);
DelPic(pic_);
}
}
int lastMes(){
SetFont(144/sc,"MS ゴシック",128,0,0,0,700);
BackMode(1);
TextColor(0,0,0);
TextWrite("おしまい",basePic,20/sc+2,500/sc+2);
TextColor(255,0,0);
TextWrite("おしまい",basePic,20/sc,500/sc);
}
int playBGM(){
if(bgms==1){
mes(MIDI_END){
PlayMIDI(bgm);
}
PlayMIDI(bgm);
}
}
int exit(){
int ans;
ans=MsgBox("終了しますか?",0x24);
if(ans==7)return;
CloseWinAll();
ExitTitle();
del_all;
del_me;
}
int playSE(){
}
int zoomin(){
if(zoom==1){
int scz;
int i,j;
scz=2;
zoomPic=CreatePic(basePic,picW+10,(picH0+picH*2)/scz);
SetPaintColor( 0xffffff );
SetLineSize(1);
DrawRect(zoomPic,0,0,picW+10,(picH0+picH*2)/scz);
MoveSPic(pic[0],0,0,picW,picH0,zoomPic,picW/4+5,0,picW/scz,picH0/scz);
for(i=0;i<4;i=i+1){
j=1-i/2;
MoveSPic(pic[i+1],0,0,picW,picH,zoomPic,j*(picW/2+10),((i%2)*picH+picH0)/scz,picW/scz,picH/scz);
}
zoomWin=OpenWin(zoomPic);
CloseWin(mainWin);
}
else if(zoom==0){
mainWin=OpenWin(basePic);
CloseWin(zoomWin);
DelPic(zoomPic);
}
}
int loadIni(){
int i;
title=GetIniInt("4koma","title",1,"4koma.ini");
name=GetIniStr("4koma","name","4コマまんが","4koma.ini");
koma=GetIniInt("4koma","koma",4,"4koma.ini");
for(i=title;i<=koma;i=i+1){
file[i]=GetIniStr("4koma",StrPrint("koma%ld",i),"","4koma.ini");
}
bgm=GetIniStr("4koma","bgm","NO_BGM","4koma.ini");
if(IsExist(bgm)==0)bgms=0;
else bgms=1;
}
int makeTitle(){
pic[0]=CreatePic(pic[1],picW/sc,200/sc);
SetPaintColor(0xffffff);
SetLineSize(1);
DrawRect(pic[0],0,0,picW/sc,200/sc);
SetFont(100/sc,"MS ゴシック",128,0,0,0,500);
BackMode(1);
BgColor(255,255,255);
TextColor(0,0,255);
TextWrite("4コママンガ",pic[0],10/sc,50/sc);
}
int showHelp(){
MsgBox("わかばちゃん・びゅーわー"+LF+
"------------------------------"+LF+
"・左クリックで次のコマへ進みます。 "+LF+
"・右クリックで前のコマに戻ります。 "+LF+
"・最後までいくか右ダブルクリック "+LF+
" すると、終了するかどうかを聴い "+LF+
" てきます。「はい」で終了します。 "+LF+
"・何かキーを押すと、全部のコマを "+LF+
" 一緒に表示します。もう一度押すと "+LF+
" 元に戻ります。 "+LF+
"・[H]キーでこのヘルプを表示します。 "+LF+
"------------------------------"+LF+
"では、お楽しみください(^_^) ");
}
int putLink(){
int imgPic,linkx,linky;
str url,img;
url=GetIniStr("4koma","linkURL","","4koma.ini");
img=GetIniStr("4koma","linkIMG","","4koma.ini");
linkx=GetIniInt("4koma","linkx",0,"4koma.ini");
linky=GetIniInt("4koma","linky",0,"4koma.ini");
if(url=="")return;
if(IsExist(img)==0)return;
imgPic=LoadPic(img);
MoveSPic(imgPic,0,0,PicWidth(imgPic),PicHeight(imgPic),basePic,linkx/sc,linky/sc,PicWidth(imgPic)/(sc*2),PicHeight(imgPic)/(sc*2));
SetFont(12/sc,"MS ゴシック",128,0,0,0,1000-sc*300);
BackMode(1);
TextColor(0,0,255);
TextWrite("ホームページは",basePic,linkx/sc+18,(linky-24)/sc);
TextWrite(" ↓こちら",basePic,linkx/sc+18,(linky-12)/sc);
mes(LBDOWN){
if(MesP2>linkx/sc&&MesP2<(linkx+PicWidth(imgPic)/2)/sc&&MesP3>linky/sc&&MesP3<(linky+PicHeight(imgPic)/2)/sc){
PlayRsc(sClick);
Shell(url);
}
}
}