カテゴリ: sample サンプル

サンプル
sample

01.アルファレイヤーの追加.hsp
#include "../a2d+AlphaLayer.hsp" 背景 alCreateImageByFile 0, dir_tv+"sozai5.jpg" 画像から仮想イメージを作成(イメージID 0) alFont msgothic, 20,1 alDrawText "カーソルキーで移動", 10,10 alalSetParent 0 イメージID 0を描画先ウィンドウに貼り付け キャラ alCreateImage 1, 64,64 仮想イメージ(イメージID 1)を作って alLoadFile dir_tv+"tamadot.png", …

02.アルファレイヤーの更新.hsp
#include "../a2d+AlphaLayer.hsp" キャラ素材ロード alCreateImageByFile 0, dir_tv+"tamadot.png" 背景 alCreateImageByFile 2, dir_exe+"\\hsptv\\sozai5.jpg" 画像から仮想イメージを作成(イメージID 2) alalSetParent 2 イメージID 2を背景として貼り付け キャラ alCreateImage 1, 64,64 仮想イメージ(イメージID 1)を作って alalSetParent 1,,, 100,380…

03.アルファレイヤーのクリック.hsp
#include "../a2d+AlphaLayer.hsp" alalCallback でアルファレイヤーのメッセージ割込みを指定できるが、 マウスの移動だけでラベルに飛んでしまって wait 50/100 を待ってくれないので、timer_waitonを利用する。為にmod_TimerRepeat.hspをincludeする。 ↓#include の1行を消してみると効果を実感できると思います。 ★ #include "../mod_TimerRepeat.hsp" キャラ素材ロード alCreateImageByFile 0, dir_…

04.timer_repeatによる並行処理.hsp
#include "../mod_TimerRepeat.hsp" 並行処理1(これらのtimer_repeat内処理は一度スルーされ、続けてtimer_loop以下が処理されます。) pos 50,30 : mes "並行1:40ms毎" timer_repeat 40 40ミリ秒ごとに実行 color 255,255,255 : boxf 50,50,150,150 : color 255,0,0 line 100,100,100+(sin(M_PI*timer_cnt/10)*50),100+(cos(M_PI*timer_cnt/10)…

05.timer_repeatの精度.hsp
#include "../mod_TimerRepeat.hsp" *start t = timer_getTime() ● TimerRepeat A (間隔:100ms) timer_repeat 100, 20 timer_init: pos 0,0 : mes "TimerRepeat A" : mes "開始:"+(timer_getTime()-t)+"ms(間隔:100ms)" uniq(cy) = ginfo_cy : uniq(t)=timer_getTime() _init_end pos 0, uniq(cy) : mes…

06.timer_easeの種類.hsp
title "flg="+flg+" "+typeName(flg) : mes typeName(flg) _init_end timer_ease timer_ease z, a,b, (flg\16), 1000 if flg>=16 { color 255,255,255 : boxf } color 0+(255*int(refdval*100)/100), 0, 255-(255*int(refdval*100)/100) boxf z(0),z(1), z(0)+5,z(1)+5 if refdval >= 1.0 { a = b…

07.timer_repeat/timer_easeの応用.hsp
#include "../a2d+AlphaLayer.hsp" #include "../mod_TimerRepeat.hsp" 境界線 color 255,0,0 boxf 195,45,605,305 color 255,255,255 boxf 200,50,600,300 Box alCreateImage 0, 200,100 仮想イメージ(イメージID 0)を作って、Box内容を描画(シェイクさせるので通常の表示より少し大きく作る) alColor 64, 64, 64, 128 alFillRect 0,0 alColor 2…

08.uniq()の検証.hsp
#include "../mod_TimerRepeat.hsp" a=1 : b=2 : c=3 color 0,0,255 mes "a = "+a,1 : mes "\tb = "+b,1 : mes "\tc = "+c :pos 0 :color uniq_start mes "uniq_start" uniq()代入 uniq(a)=4 : uniq(b)=5 : uniq(c)=6 color 255,0,0 mes "\ta = "+uniq(a),1 : mes "\tb = "+uniq(b),1 : mes "\tc = …

09.waitとawaitの違い/timer_waitonとtimer_awaitonの効果.hsp
title ""+cnt loop mes " / 重たい処理 "+(d3timer()-t2)+"ms" :pos 0 loop color 255 mes "-> wait 100 ×10回 = "+(d3timer()-t3)+"ms 「重たい処理」は考慮されないのでそのまま蓄積される" mes "" color t3 = d3timer() await mes "【 await 1000 】" repeat 10 await 1000 t1=d3timer() mes "await "+cnt+" : ["+strf("%06dms",…

10.GIFアニメ表示.hsp
#include "../a2d+AlphaLayer.hsp" #include "../mod_TimerRepeat.hsp" alCreateImageByAnimationFile 0, "image/466-88.gif" GIFアニメファイル読み込み alGetFramesDelay intervals フレーム間の時間間隔を配列変数に取得 alalSetParent 0,,,250,100 描画先ウィンドウにGIFアニメ(アルファレイヤーID 0)を貼り付け objsize 200,30, 40 pos 10,200 butto…

11.1枚のPNGファイルでアニメーション.hsp
#include "../a2d+AlphaLayer.hsp" #include "../mod_TimerRepeat.hsp" delays = 50,50,50,50,50,50,100,200,200,200,100,40,40,40,40,40 フレーム間の時間間隔 配列(bomb02 は縦に16コマ分並べたpng画像) alCreateImageByAnimationFile 0, "image/bomb02.png", 16,0,delays alGetFramesDelay intervals フレーム間の時間間隔を配列変数に…

12.レイヤードウィンドウ.hsp
#include "../a2d+AlphaLayer.hsp" alCreateImageByFile 0, dir_tv+"runner.png" レイヤードウィンドウを作成(p3=2でドラッグしてウィンドウを移動できます) alalWindow 0,1, 2 gsel 1,2 stop sample\12.レイヤードウィンドウ.hsp…

13.レイヤードウィンドウでアニメーション.hsp
#include "../a2d+AlphaLayer.hsp" #include "../mod_TimerRepeat.hsp" alCreateImageByAnimationFile 0, "image/bomb02.png", 16 レイヤードウィンドウを作成(p3=4でクリックを透過できます) alalWindow 0,1, 4 alalAlpha 0, 180 gsel 1,2 timer_repeat 50 if timer_cnt == 0 : alalWidth 0, ,, ginfo_mx,ginfo_my, 4 マウス追…

14.(TimerRepeat_ver2.5)uniq2でひとつ外側を取得.hsp
#include "../mod_TimerRepeat.hsp" randomize font msgothic,10 1つ目。 timer_repeat 500, 5 timer_init: mes "timer_repeat 1つ目。" _init_end uniq(x) = rnd(600) : uniq(y) = rnd(440) boxf uniq(x)-5, uniq(y)-5, uniq(x), uniq(y) pos uniq(x), uniq(y) : mes ""+uniq(x)+","+uniq(y) timer_dei…

EX1.スライドインメニュー【timer_repeat内に別のtimer_repeatを記述】.hsp
#include "../a2d+AlphaLayer.hsp" #include "../mod_TimerRepeat.hsp" 先に Menu のArtlet2D仮想イメージを4つ作ってしまう alCreateImage 1, 200,50 Artlet2D仮想イメージ(imageID=1) alFont "", 20 フォントを設定 alColor 64, 64, 64, 200 alFillRect 0,0, 200,50 alColor 255, 255, 255, 255 alDrawText "Menu 1", 0, 0, 20…

EX2.ADVゲーム画面(だけ)【アルファレイヤーの中に子アルファレイヤーを作る】.hsp
#include "../a2d+AlphaLayer.hsp" #include "../mod_TimerRepeat.hsp" #define stick_stop(%1=2047) *@ :wait 1 :stick _stick_ :if((_stick_&&(%1))==0){goto *@b} レイヤーID #enum global temp_imageID = 0 #enum global mesWin_layerID = 1 #enum global mesWin_layerID_name #enum global mesWi…

EX3.(HSP3Dish-TimerRepeat)ブロック崩し【timer_setTimerEngineマニュアル】.hsp
title "ブロック崩し" buffer 1,x2,y2 メニュー薄膜用のバッファ gsel 0 cls 4 effectFlg=1 *gstart clrflag=0 クリアフラグ blsize=16 ボールのサイズ blspd=10 ボールのスピード blx=200:bly=200 ボールの座標 bpx=4:bpy=4 XY方向のボール座標加算値 bk=0 ブロックを崩すフラグ(1=崩す) mblsize=-blsize barsize=64 バーのサイズ barx=240:bary=ginfo_winy-60 バーの座標 mae_bar…

EX4.Floppy-Word【アルファレイヤー/タイマーリピート利用ミニゲーム】.hsp
#include "hsptvapp.as" GitHubからモジュールを取得。 #include "../a2d+AlphaLayer.hsp"/ #include "../mod_TimerRepeat.hsp"/ デバッグ時の素材ディレクトリ #ifdef _debug sozaiDir = dir_exe+"\\hsptv\\" if dir_exe!dir_cur : bcopy dir_exe+"\\hsptvapp.dll", dir_cur+"\\hsptvapp.dll" #else sozaiDir = "" #endif …

EX5.スライダーオブジェクト.hsp
#include "../a2d+AlphaLayer.hsp" #include "../mod_TimerRepeat.hsp" スライダーの設定値を簡単に取得するため利用 スライダー 横棒 alCreateImage 0, 300,30 仮想イメージ(ID 0) alColor 0, 0, 0, 1 alFillRect 薄膜貼っとかないと円の上端と下端がクリック反応しない alColor 200, 200, 200, 255 alFillRect 15, alGetHeight()/2-5, alGetWidth()-30, 10 とり…

表示件数 19 件
version