〜 グラフィック 〜
コピーエリアが画像をはみだす場合に逆サイドを自動補完コピー

タイル状(無限に繋げられる)画像だけに有効ですが、上下左右いずれかの端を越えるエリアをコピーする場合、
はみだした残りの部分は逆サイドの画像内容をコピーするというモジュールサンプルで、
使い方(指定パラメータ)は標準のgcopy命令と互換性のある命令となっています。
	
jointless ウィンドウID, X座標, Y座標, 横幅, 高さ
ウィンドウIDコピー元のウィンドウIDを指定。
X座標コピー元の左上を基点としたX座標を指定。
Y座標コピー元の左上を基点としたY座標を指定。
横幅コピーする画像の横幅を指定。
高さコピーする画像の高さを指定。
 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
#module
#deffunc jointless int, int, int, int, int
	mref id, 0 : mref sx, 1 : mref sy, 2 : mref gx, 3 : mref gy, 4
	cx = csrx : cy = csry
	pos cx, cy : gcopy id, sx, sy, gx - sx, gy - sy
	pos cx + gx - sx, cy : gcopy id, , sy, sx, gy - sy
	pos cx, cy + gy - sy : gcopy id, sx, , gx - sx, sy
	pos cx + gx - sx, cy + gy - sy : gcopy id, , , sx, sy
	return
#global

	// 使用する画像をバッファに配置しスクロール対象に定義
	buffer 2
	x = winx : y = winy
	color 255 : boxf , , x / 2, y / 2
	color , 255 : boxf x / 2, , x , y / 2
	color , , 255 : boxf , y / 2, x / 2, y
	color 50, 50, 50 : boxf x / 2, y / 2, x, y
	// コピー
	gsel 0
	repeat
		redraw 0
		pos 0, 0 : jointless 2, cnt * 2 \ x, cnt * 2 \ y, x, y
		redraw 1
		wait 3
	loop
jointless ウィンドウID, X座標, Y座標, 横幅, 高さ
ウィンドウIDコピー元のウィンドウIDを指定。
X座標コピー元の左上を基点としたX座標を指定。
Y座標コピー元の左上を基点としたY座標を指定。
横幅コピーする画像の横幅を指定。
高さコピーする画像の高さを指定。
 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
#module
#deffunc jointless int id, int sx, int sy, int gx, int gy, local cx, local cy
	cx = ginfo_cx : cy = ginfo_cy
	pos cx, cy : gcopy id, sx, sy, gx - sx, gy - sy
	pos cx + gx - sx, cy : gcopy id, , sy, sx, gy - sy
	pos cx, cy + gy - sy : gcopy id, sx, , gx - sx, sy
	pos cx + gx - sx, cy + gy - sy : gcopy id, , , sx, sy
	return
#global

	// 使用する画像をバッファに配置しスクロール対象に定義
	buffer 1
	x = ginfo_winx : y = ginfo_winy
	color 255 : boxf , , x / 2, y / 2
	color , 255 : boxf x / 2, , x , y / 2
	color , , 255 : boxf , y / 2, x / 2, y
	color 50, 50, 50 : boxf x / 2, y / 2, x, y
	// コピー
	gsel 0
	repeat
		redraw 0
		pos 0, 0 : jointless 1, cnt * 2 \ x, cnt * 2 \ y, x, y
		redraw 1
		wait 3
	loop