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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
{
id: "text_controller_fading",
ignore_collide: true,
hidden_in_game: true,
zorder: 50,
properties: {
set_text: "def(text) [set(self.vars.txt, text), fire_event(self, 'load')]",
hide: "def() [fire_event(me, 'hide')]",
},
vars: {
txt: "TEXT",
size: 2,
},
on_load: "[if(txt, text(txt, font, size)),animation('fadein')]",
on_end_fadein_anim: "animation('normal')",
on_end_normal_anim: "animation('normal')",
on_end_fadeout_anim: "animation('invisible')",
on_end_invisible_anim: "animation('invisible')",
on_enter_invisible_anim: "set(text_alpha,0)",
on_enter_normal_anim: "set(text_alpha,255)",
on_process_fadein: "set(text_alpha, (time_in_animation * 255)/100 )",
on_process_fadeout: "set(text_alpha, ((100-time_in_animation) * 255)/100 )",
on_hide: "animation('fadeout')",
editor_info: {
category: "controllers",
var: [
{
name: "txt",
type: "text",
value: "'TEXT'",
},
{
name: "font",
type: "text",
value: "'door_label'",
},
{
name: "size",
value: 2,
},
],
},
animation: [
{
image: "effects/particles.png",
x: 148,
y: 197,
w: 28,
h: 28,
frames: 1,
id: "fadein",
duration: 100,
},
{
image: "effects/particles.png",
x: 148,
y: 197,
w: 28,
h: 28,
frames: 1,
id: "fadeout",
duration: 100,
},
{
image: "effects/particles.png",
x: 148,
y: 197,
w: 28,
h: 28,
frames: 1,
id: "normal",
duration: 100,
},
{
image: "effects/particles.png",
x: 148,
y: 197,
w: 28,
h: 28,
frames: 1,
id: "invisible",
duration: 100,
},
],
}
|