; this is sample script
; 2002/04/23 by Gaku - bitmap viewer

load("img")

dx = 20
dy = 20

x = 0
y = 0

LEFT  = 12
RIGHT = 13
UP    = 14
DOWN  = 15

if (2 > arg) {
	print("few args\n")
	return 0
}

win = img.window()
buf = img.image(320, 240)
bmp = img.image(arg[1])

img.fill(buf, 0)

{
	img.copy(buf, bmp, x, y)
	img.copy(win, buf)

	wait()
	c = inkey()

	if (0 == c)
		continue

	img.fill(buf, 0)

	if (UP == c) {
		y = y - dy
		continue
	}
	if (DOWN == c) {
		y = y + dy
		continue
	}
	if (LEFT == c) {
		x = x - dx
		continue
	}
	if (RIGHT == c) {
		x = x + dx
		continue
	}
}

; -------------------
; img.window ( )
;   ʂɉ摜\邽߂ɕKvȏ擾
;
; -------------------
; img.image ( w , h )
; img.image ( name )
;   摜𑀍삷邽߂ɕKvȏ쐬
;   ƍw肷邩At@Cw
;
; -------------------
; img.fill ( dst , clr )
; img.fill ( dst , clr , x , y , w , h )
;   摜FœhԂ
;   x , y , w , h ͏ȗ
;
; -------------------
; img.copy ( dst , src )
; img.copy ( dst , src , x , y , sx , sy , w , h )
;   摜̋`Rs[
;   x , y , sx , sy , w , h ͏ȗ
