uniq()

ユニークな変数を定義

uniq () [マクロ]

(プラグイン / モジュール : mod_TimerRepeat)

解説

指定した区間において、名前の被らないユニークな変数として扱えるようになります。
Debugウィンドウ>変数>モジュールを見てもらうとわかりますが、名前の違う変数を定義するようになっているだけです。

timer_repeat,timer_loopには既にそれぞれuniq_start,uniq_endが組み込まれています。
そのため、timer_repeattimer_loop区間ではuniq_start,uniq_endを記述することなくuniq()が使用できます。

uniq2, uniq3, 〜 uniqN 〜, uniq9 と指定するとN個外側のスコープのuniq()を指定することができます。

サンプル

//
//  uniq()検証用サンプルスクリプト
//
#include "mod_uniq.hsp"

a=1 : b=2 : c=3
mes "a = "+a,1 : mes "\tb = "+b,1 : mes "\tc = "+c :pos 0

uniq_start

	uniq(a)=4 : uniq(b)=5 : uniq(c)=6
	mes "a = "+uniq(a),1 : mes "\tb = "+uniq(b),1 : mes "\tc = "+uniq(c) :pos 0
	
	uniq_start

		uniq(a)=7 : uniq(b)=8 : uniq(c)=9
		mes "a = "+uniq(a),1 : mes "\tb = "+uniq(b),1 : mes "\tc = "+uniq(c) :pos 0

	uniq_end
	
	uniq_start

		uniq(a) = "あ" : uniq(b) = "い" ;: uniq(c) = "う"
		mes "a = "+uniq(a),1 : mes "\tb = "+uniq(b),1 : mes "\tc = "+uniq(c) :pos 0
		ddim uniq(d),4
		uniq(d)=1.2, 2.3, 3.4
		mes "d = ",1
		foreach uniq(d)
			mes ""+uniq(d)(cnt)+", ",1
		loop
		mes "" :pos 0

	uniq_end

	mes "a = "+uniq(a),1 : mes "\tb = "+uniq(b),1 : mes "\tc = "+uniq(c) :pos 0
	
uniq_end

mes "a = "+a,1 : mes "\tb = "+b,1 : mes "\tc = "+c :pos 0

関連項目

timer_repeatタイマーループの始まりの場所を示す(mod_TimerRepeat)
timer_loopタイマーループの始まりに戻る(mod_TimerRepeat)
timer_killタイマーループを終了させる(mod_TimerRepeat)
timer_initタイマーループ初期化処理(_init_end まで)(mod_TimerRepeat)
timer_deinitタイマーループ後始末処理(mod_TimerRepeat)
timer_breakタイマーループから抜けだしてタイマーも終了させる(mod_TimerRepeat)
timer_continueタイマーループをやり直す(mod_TimerRepeat)
timer_cntタイマーループのカウンター(mod_TimerRepeat)
timer_intervalstimer_repeat内で繰り返し間隔の取得(mod_TimerRepeat)
timer_getTimerTime実行中のタイマーループの経過時間を取得(mod_TimerRepeat)
timer_getTimeミリ秒タイマー(mod_TimerRepeat)
timer_setTimerSpeedタイマーループの繰り返し間隔を変更(mod_TimerRepeat)
timer_easeタイマーループ内で時間変化によるイージング値の取得(mod_TimerRepeat)
geteaseT時間変化によるイージング値を取得(mod_TimerRepeat)
timer_setTimerEngineタイマーの実行タイミングを変更する(オート/マニュアル)(mod_TimerRepeat)
timer_fireタイマーのマニュアル実行時に確認/実行を行う。(mod_TimerRepeat)
uniq_startuniq()のスコープ開始(mod_TimerRepeat)
uniqユニークな変数を定義(mod_TimerRepeat)
uniq_enduniq()のスコープ終了(mod_TimerRepeat)
timer_waiton実行を一定時間中断する(タイマーループ割り込み+oncmd等の割り込みジャンプに対応)(mod_TimerRepeat)
timer_awaiton一定の時間で待つ(タイマーループ割り込み+oncmd等の割り込みジャンプに対応)(mod_TimerRepeat)
timer_stopプログラム中断(タイマーループ割り込みに対応)(mod_TimerRepeat)

サンプル逆引き (9)

05.timer_repeatの精度.hsp#include "../mod_TimerRepeat.hsp" *start t = timer_getT..
07.timer_repeat/timer_easeの応用.hsp#include "../a2d+AlphaLayer.hsp" #include "../mod_Timer..
08.uniq()の検証.hsp#include "../mod_TimerRepeat.hsp" a=1 : b=2 : c=3 color..
14.(TimerRepeat_ver2.5)uniq2でひとつ外側を取得.hsp#include "../mod_TimerRepeat.hsp" randomize font msgoth..
EX1.スライドインメニュー【timer_repeat内に別のtimer_repeatを記述】.hsp#include "../a2d+AlphaLayer.hsp" #include "../mod_Timer..
EX2.ADVゲーム画面(だけ)【アルファレイヤーの中に子アルファレイヤーを作る】.hsp#include "../a2d+AlphaLayer.hsp" #include "../mod_Timer..
EX3.(HSP3Dish-TimerRepeat)ブロック崩し【timer_setTimerEngineマニュアル】.hsptitle "ブロック崩し" buffer 1,x2,y2 メニュー薄膜用のバッファ gsel 0 cls 4..
EX4.Floppy-Word【アルファレイヤー/タイマーリピート利用ミニゲーム】.hsp#include "hsptvapp.as" GitHubからモジュールを取得。 #include "../a..
EX5.スライダーオブジェクト.hsp#include "../a2d+AlphaLayer.hsp" #include "../mod_Timer..

情報

プラグイン / モジュールmod_TimerRepeat
バージョン2.5
作成日2024/1/5
著作者MIZUSHIKI
URLhttp://suwa.pupu.jp/
備考mod_TimerRepeat.hspをインクルードすること。
タイプ拡張命令
グループプログラム制御マクロ
対応環境・Windows 版 HSP