-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdraw.txt
139 lines (121 loc) · 3.21 KB
/
draw.txt
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//----- Variables -----------------------------------------------------------------------------------------------------
display_mode = 0
draw: pixel = 59392
o_down = 8
o_up = 8
scaling = 1
size_mod = 0
stretch_x = 1
stretch_y = 1
//----- Broadcast received events -------------------------------------------------------------------------------------
WhenBroadcastReceived(display_size)
{
stretch_x = 1;
stretch_y = 1;
display_mode = ((display_mode + 1) % 4);
If (display_mode == 0)
{
scaling = 1;
size_mod = 0;
}
If (display_mode == 1)
{
scaling = (1.5 + ((o_up + o_down) / 128));
size_mod = (0.75 + ((o_up + o_down) / 512));
}
If (display_mode == 2)
{
scaling = (1.5 + ((o_up + o_down) / 128));
size_mod = (1 + ((o_up + o_down) / 512));
stretch_x += (0.25 - ((o_up + o_down) / 192));
}
If (display_mode == 3)
{
scaling = 2;
size_mod = 0.24;
}
Call draw;
Call fade;
}
WhenBroadcastReceived(draw)
{
Call draw;
}
WhenBroadcastReceived(pause)
{
Call fade;
}
WhenBroadcastReceived(Project not saving fix)
{
display_mode = 0;
scaling = 1;
size_mod = 0;
stretch_x = 1;
stretch_y = 1;
o_up = 8;
o_down = 8;
}
//----- Custom blocks -------------------------------------------------------------------------------------------------
Define draw (warp=true)
{
Pen.Clear();
Motion.GoToXY(0, 0);
Pen.SetPenSizeTo(750);
Pen.SetPenColorToColor(bg_color);
Pen.Down();
Pen.Clear();
Pen.SetPenSizeTo((scaling + size_mod));
If (render_enabled == 1)
{
Motion.GoToXY((((scaling * -128) + 1) * stretch_x), (((scaling * (120 - o_up)) - 1) * stretch_y));
draw: pixel = (256 * o_up);
Repeat ((240 - (o_up + o_down)))
{
Repeat (256)
{
draw: pixel += 1;
If (Not (((pixel_buffer[draw: pixel] == 0) Or (pixel_buffer[draw: pixel] == bg_color))))
{
Pen.SetPenColorToColor(pixel_buffer[draw: pixel]);
Pen.Down();
Pen.Clear();
}
Motion.ChangeXBy((scaling * stretch_x));
}
Motion.SetX((((scaling * -128) + 1) * stretch_x));
Motion.ChangeYBy(((scaling * -1) * stretch_y));
}
}
}
Define fade (warp=false)
{
Motion.GoToXY(0, 0);
Pen.SetPenSizeTo(750);
Pen.SetPenColorToColor(#000000);
Pen.SetPenTo(transparency, 50);
Pen.Down();
Pen.Clear();
}
//----- Orphaned blocks -----------------------------------------------------------------------------------------------
If (gui[1] == 1)
{
Variable.Hide(scaling);
Variable.Hide(size_mod);
Variable.Hide(o_up);
Variable.Hide(o_down);
Variable.Hide(stretch_x);
Variable.Hide(stretch_y);
List.ReplaceItem(gui, 1, 0);
}
Else
{
Variable.Show(scaling);
Variable.Show(size_mod);
Variable.Show(o_up);
Variable.Show(o_down);
Variable.Show(stretch_x);
Variable.Show(stretch_y);
List.ReplaceItem(gui, 1, 1);
}
//----- Costumes ------------------------------------------------------------------------------------------------------
costume1.png