目次

縦スクロール

 縦スクロールは、元画像からピクセルデータを取得しておき
 縦方向の、どこに該当ピクセルデータを表示するかを指定する
 だけで実現できます。

 元画像を、円柱に貼り付けて、垂直に指定量だけ
 回転後、展開して平面に戻す操作と同じになります。

 左に元画像、右に縦スクロールした画像を表示させると
 次のようになります。
 (縦に、白線を入れて分かりやすくしています。)




処理内容

 シフト量を指定して、表示サブルーチンをコールします。  表示位置のY座標に、シフト量を加算し、画像サイズの  高さで割った余りを、シフト後のY座標にします。  正負のシフト量に対応します。  元画像と並べて表示したいので、X座標に横幅+αの  値を加えています。 --------------------------------------------------  title "v scroll" ; set screen dimensions  screen 0,160*2+2,100 ; constants  ylast = 100  xlast = 160 ; get image  picload "crossx.bmp",1 ; shift  shift = -60  gosub *image_vertical_shift  stop *image_vertical_shift  ; conversion  if (shift < 0) {   shift += ylast  }  for j,0,ylast,1   for i,0,xlast,1    ; get informations of current position    pget i,j    ; shift    k = j + shift    k \= ylast    ; show    pset i+xlast+2,k   next  next  return  end --------------------------------------------------

目次

inserted by FC2 system