-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from TML233/develop
v0.2.0
- Loading branch information
Showing
63 changed files
with
729 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
depth=DEPTH_UI.PANEL; | ||
|
||
_x=320; | ||
_y=400; | ||
_up=20; | ||
_down=0; | ||
_left=250; | ||
_right=250; | ||
_color=c_black; | ||
_alpha=0; | ||
_alpha_base=0.6; | ||
|
||
_queue_text=ds_queue_create(); | ||
_queue_duration=ds_queue_create(); | ||
_list_inst=ds_list_create(); | ||
_list_time=ds_list_create(); | ||
_list_destroy_inst=ds_list_create(); | ||
_list_destroy_time=ds_list_create(); | ||
|
||
_showed=false; | ||
_up_previous=_up; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//四角 | ||
//左上 | ||
draw_sprite_ext(spr_closed_captions_corner,0,_x-_left-sprite_get_width(spr_closed_captions_corner),_y-_up-sprite_get_height(spr_closed_captions_corner),1,1,0,_color,_alpha_base*_alpha); | ||
//左下 | ||
draw_sprite_ext(spr_closed_captions_corner,0,_x-_left-sprite_get_width(spr_closed_captions_corner),_y+_down+sprite_get_height(spr_closed_captions_corner),1,-1,0,_color,_alpha_base*_alpha); | ||
//右上 | ||
draw_sprite_ext(spr_closed_captions_corner,0,_x+_right+sprite_get_width(spr_closed_captions_corner),_y-_up-sprite_get_height(spr_closed_captions_corner),-1,1,0,_color,_alpha_base*_alpha); | ||
//右下 | ||
draw_sprite_ext(spr_closed_captions_corner,0,_x+_right+sprite_get_width(spr_closed_captions_corner),_y+_down+sprite_get_height(spr_closed_captions_corner),-1,-1,0,_color,_alpha_base*_alpha); | ||
|
||
//填充 | ||
//左 | ||
draw_sprite_ext(spr_pixel,0,_x-_left-sprite_get_width(spr_closed_captions_corner),_y-_up,sprite_get_width(spr_closed_captions_corner),_up+_down,0,_color,_alpha_base*_alpha); | ||
//右 | ||
draw_sprite_ext(spr_pixel,0,_x+_right,_y-_up,sprite_get_width(spr_closed_captions_corner),_up+_down,0,_color,_alpha_base*_alpha); | ||
//上 | ||
draw_sprite_ext(spr_pixel,0,_x-_left,_y-_up-sprite_get_height(spr_closed_captions_corner),_left+_right,sprite_get_height(spr_closed_captions_corner),0,_color,_alpha_base*_alpha); | ||
//下 | ||
draw_sprite_ext(spr_pixel,0,_x-_left,_y+_down,_left+_right,sprite_get_height(spr_closed_captions_corner),0,_color,_alpha_base*_alpha); | ||
//中间 | ||
draw_sprite_ext(spr_pixel,0,_x-_left,_y-_up,_left+_right,_up+_down,0,_color,_alpha_base*_alpha); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ds_queue_destroy(_queue_text); | ||
ds_queue_destroy(_queue_duration); | ||
ds_list_destroy(_list_inst); | ||
ds_list_destroy(_list_time); | ||
ds_list_destroy(_list_destroy_inst); | ||
ds_list_destroy(_list_destroy_time); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
//处理新增字幕队列 | ||
while(!ds_queue_empty(_queue_text)){ | ||
var text=ds_queue_dequeue(_queue_text); | ||
var duration=ds_queue_dequeue(_queue_duration); | ||
|
||
var inst=instance_create_depth(0,0,0,text_typer); | ||
inst.text="{instant true}{alpha 1}{gui true}{scale 2}{depth "+string(DEPTH_UI.TEXT)+"}"+text+"&"; | ||
with(inst){ | ||
event_user(15); | ||
} | ||
inst.alpha_override=0; | ||
Anim_Stop(inst,"alpha_override"); | ||
Anim_New(inst,"alpha_override",0,0,0,1,10,5); | ||
ds_list_add(_list_inst,inst); | ||
ds_list_add(_list_time,duration); | ||
} | ||
|
||
//处理显示时间 | ||
var proc=0; | ||
repeat(ds_list_size(_list_inst)){ | ||
if(instance_exists(_list_inst[|proc])){ | ||
if(_list_time[|proc]>0){ | ||
_list_time[|proc]-=1; | ||
} | ||
}else{ | ||
_list_time[|proc]=0; | ||
} | ||
proc+=1; | ||
} | ||
|
||
//处理字幕显示完毕 | ||
var proc=0; | ||
repeat(ds_list_size(_list_inst)){ | ||
if(_list_time[|proc]<=0){ | ||
var inst=_list_inst[|proc]; | ||
if(instance_exists(inst)){ | ||
Anim_Stop(inst,"alpha_override"); | ||
Anim_New(inst,"alpha_override",0,0,1,-1,10); | ||
ds_list_add(_list_destroy_inst,inst); | ||
ds_list_add(_list_destroy_time,10); | ||
} | ||
ds_list_delete(_list_inst,proc); | ||
ds_list_delete(_list_time,proc); | ||
//proc-=1; | ||
}else{ | ||
break; | ||
} | ||
} | ||
|
||
//处理字幕高度 | ||
var proc=0; | ||
var height=0; | ||
repeat(ds_list_size(_list_inst)){ | ||
var inst=_list_inst[|proc]; | ||
if(instance_exists(inst)){ | ||
height+=inst.height; | ||
} | ||
proc+=1; | ||
} | ||
|
||
if(_up_previous!=height){ | ||
var delay=0; | ||
if(height<_up_previous){ | ||
delay=10; | ||
} | ||
Anim_Stop(self,"_up"); | ||
Anim_New(self,"_up",ANIM_TWEEN.CUBIC,ANIM_EASE.OUT,_up,height-_up,10,delay); | ||
_up_previous=height; | ||
} | ||
|
||
var up_show=0; | ||
if(height>_up){ | ||
up_show=_up; | ||
}else{ | ||
up_show=height; | ||
} | ||
|
||
//处理字幕位置 | ||
var proc=0; | ||
var yy=_y-up_show; | ||
repeat(ds_list_size(_list_inst)){ | ||
var inst=_list_inst[|proc]; | ||
if(instance_exists(inst)){ | ||
inst.x=_x-_left; | ||
if(proc==ds_list_size(_list_inst)-1){ | ||
inst.y=_y-inst.height; | ||
}else{ | ||
inst.y=yy; | ||
} | ||
yy+=inst.height; | ||
} | ||
proc+=1; | ||
} | ||
|
||
//处理销毁实例列表 | ||
var proc=0; | ||
repeat(ds_list_size(_list_destroy_inst)){ | ||
if(_list_destroy_time[|proc]<=0){ | ||
var inst=_list_destroy_inst[|proc]; | ||
if(instance_exists(inst)){ | ||
instance_destroy(inst); | ||
} | ||
}else{ | ||
_list_destroy_time[|proc]-=1; | ||
} | ||
if(!instance_exists(_list_destroy_inst[|proc])){ | ||
ds_list_delete(_list_destroy_inst,proc); | ||
ds_list_delete(_list_destroy_time,proc); | ||
proc-=1; | ||
} | ||
proc+=1; | ||
} | ||
|
||
if(!_showed&&!ds_list_empty(_list_inst)){ | ||
_showed=true; | ||
Anim_Stop(self,"_alpha"); | ||
Anim_New(self,"_alpha",0,0,0,1,10); | ||
}else if(_showed&&ds_list_empty(_list_inst)){ | ||
_showed=false; | ||
Anim_Stop(self,"_alpha"); | ||
Anim_New(self,"_alpha",0,0,1,-1,10,5); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,4 +64,6 @@ _depth=0; | |
event_user(5); | ||
|
||
width=0; | ||
height=0; | ||
height=0; | ||
alpha_override=undefined; | ||
_alpha_override_previous=-1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
user_char=-1; | ||
multiple=false; | ||
_triggered=false; | ||
_triggered=false; | ||
_collided_previous=false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
///@desc Trigger | ||
if(_triggered){ | ||
exit; | ||
}else{ | ||
_triggered=true; | ||
} | ||
_triggered=true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
///@desc Leave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,19 @@ | ||
if(!_triggered){ | ||
var user=user_char; | ||
if(user>=-1){ | ||
var result=false; | ||
if(instance_exists(char)){ | ||
with(char){ | ||
if(char_id==user||user==-1){ | ||
result=place_meeting(x,y,other); | ||
if(result){ | ||
break; | ||
} | ||
} | ||
var user=user_char; | ||
var result=false; | ||
if(instance_exists(char)){ | ||
with(char){ | ||
if(char_id==user||user==-1){ | ||
result=place_meeting(x,y,other); | ||
if(result){ | ||
break; | ||
} | ||
} | ||
if(result){ | ||
event_user(0); | ||
} | ||
} | ||
}else if(multiple){ | ||
var user=user_char; | ||
if(user>=-1){ | ||
var result=false; | ||
if(instance_exists(char)){ | ||
with(char){ | ||
if(char_id==user||user==-1){ | ||
result=place_meeting(x,y,other); | ||
if(result){ | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
if(!result){ | ||
_triggered=false; | ||
} | ||
} | ||
} | ||
if(!_triggered&&result){ | ||
event_user(0); | ||
_collided_previous=true; | ||
}else if(_triggered&&_collided_previous&&!result){ | ||
event_user(1); | ||
_collided_previous=false; | ||
} |
Oops, something went wrong.