<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FlyWithLua &#8211; Macな暮らし</title>
	<atom:link href="https://polo-web.com/category/flywithlua/feed/" rel="self" type="application/rss+xml" />
	<link>https://polo-web.com</link>
	<description></description>
	<lastBuildDate>Wed, 25 Feb 2026 23:47:27 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://polo-web.com/wp-content/uploads/2025/03/site-icon-150x150.png</url>
	<title>FlyWithLua &#8211; Macな暮らし</title>
	<link>https://polo-web.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>便利なQuickLookコマンドを活用</title>
		<link>https://polo-web.com/use-the-handy-quicklook-command/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Thu, 09 Oct 2025 02:36:46 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=16400</guid>

					<description><![CDATA[X-PlaneにあるQuickLookコマンドは非常に便利な機能ですが、設定がちょっと面倒なところがあります。そこでFlyWithLuaを使ってプラグインを …]]></description>
										<content:encoded><![CDATA[
<p>X-PlaneにあるQuickLookコマンドは非常に便利な機能ですが、設定がちょっと面倒なところがあります。そこでFlyWithLuaを使ってプラグインを作成してみました。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="299" height="443" src="https://polo-web.com/wp-content/uploads/2025/10/post-id-16400.jpg" alt="" class="wp-image-16401" srcset="https://polo-web.com/wp-content/uploads/2025/10/post-id-16400.jpg 299w, https://polo-web.com/wp-content/uploads/2025/10/post-id-16400-202x300.jpg 202w" sizes="(max-width: 299px) 100vw, 299px" /></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-lua" data-file="QuickLook.lua" data-lang="Lua"><code>require &quot;graphics&quot;

local x1 = 15
--local x2 = 0
local y1 = 100
--local y2 = 0

--------------------------＊＊＊＊＊＊＊＊＊＊--------------------------
------------------------ テキスト、形の描画関数 ------------------------
--------------------------＊＊＊＊＊＊＊＊＊＊--------------------------
function draw_quick_look_memory()

	-- グラフィックシステムを初期化する
	XPLMSetGraphicsState(0,0,0,1,1,0,0)

	--マウスが乗った時全体を表示
	if MOUSE_Y &gt; 700 or MOUSE_Y &lt; 100 or MOUSE_X &gt; x1+350 or MOUSE_X &lt; x1 then
		return
	end

	--------------------------------------------------------
	-- 全体の透明な背景を描く
	--------------------------------------------------------
	graphics.set_color(0, 0, 0, 0.5)					--色を設定
	graphics.draw_rectangle(x1, y1, x1+350, 700)		--上の色の四角を描画

	--------------------------------------------------------
	-- ラインを描く
	--------------------------------------------------------
	graphics.set_color(x1, 1, 0, 0.5)				--以下のラインの色
	graphics.set_width(1)									--以下のラインの幅

	graphics.draw_line(x1, y1, x1, 700)			--一番左の縦ライン
	graphics.draw_line(x1+100, y1, x1+100, 700)	--左から２番目の縦ライン
	graphics.draw_line(x1+50, 300, x1+50, 400)		--左から短い３番目の縦ライン
	graphics.draw_line(x1+200, y1, x1+200, 700)	--左から４番目の縦ライン
	graphics.draw_line(x1+250, 300, x1+250, 400)		--左から短い５番目の縦ライン
	graphics.draw_line(x1+300, y1, x1+300, 700)	--左から６番目の縦ライン
	graphics.draw_line(x1+350, y1, x1+350, 700)	--一番右の縦ライン

	graphics.draw_line(x1, 700, x1+350, 700)	--一番上の横ライン
	graphics.draw_line(x1+300, 675, x1+350, 675)			--１段目の短横ライン
	graphics.draw_line(x1+300, 650, x1+350, 650)			--２段目の短横ライン
	graphics.draw_line(x1+300, 625, x1+350, 625)			--３段目の短横ライン
	graphics.draw_line(x1, 600, x1+350, 600)	--２段目の横ライン
	graphics.draw_line(x1+300, 575, x1+350, 575)			--１段目の短横ライン
	graphics.draw_line(x1+300, 550, x1+350, 550)			--２段目の短横ライン
	graphics.draw_line(x1+300, 525, x1+350, 525)			--３段目の短横ライン
	graphics.draw_line(x1, 500, x1+350, 500)	--３段目の横ライン
	graphics.draw_line(x1+300, 475, x1+350, 475)			--１段目の短横ライン
	graphics.draw_line(x1+300, 450, x1+350, 450)			--２段目の短横ライン
	graphics.draw_line(x1+300, 425, x1+350, 425)			--３段目の短横ライン
	graphics.draw_line(x1, 400, x1+350, 400)	--４段目の横ライン
	graphics.draw_line(x1+300, 375, x1+350, 375)			--１段目の短横ライン
	graphics.draw_line(x1+300, 350, x1+350, 350)			--２段目の短横ライン
	graphics.draw_line(x1+300, 325, x1+350, 325)			--３段目の短横ライン
	graphics.draw_line(x1, 300, x1+350, 300)	--５段目の横ライン
	graphics.draw_line(x1+300, 275, x1+350, 275)			--１段目の短横ライン
	graphics.draw_line(x1+300, 250, x1+350, 250)			--２段目の短横ライン
	graphics.draw_line(x1+300, 225, x1+350, 225)			--３段目の短横ライン
	graphics.draw_line(x1, 200, x1+350, 200)	--６段目の横ライン
	graphics.draw_line(x1+300, 175, x1+350, 175)			--１段目の短横ライン
	graphics.draw_line(x1+300, 150, x1+350, 150)			--２段目の短横ライン
	graphics.draw_line(x1+300, 125, x1+350, 125)			--３段目の短横ライン
	graphics.draw_line(x1, y1, x1+350, 100)	--一番下の横ライン



	--------------------------------------------------------
	-- quick_lookテキストの描画
	--------------------------------------------------------
	draw_string_Helvetica_10(x1+30, 645, &quot;numpad-0&quot;)
	draw_string_Helvetica_10(x1+130, 645, &quot;numpad-1&quot;)
	draw_string_Helvetica_10(x1+230, 645, &quot;numpad-2&quot;)
	--------------------------------------------------------
	draw_string_Helvetica_10(x1+30, 545, &quot;numpad-3&quot;)
	draw_string_Helvetica_10(x1+130, 545, &quot;numpad-4&quot;)
	draw_string_Helvetica_10(x1+230, 545, &quot;numpad-5&quot;)
	--------------------------------------------------------
	draw_string_Helvetica_10(x1+30, 445, &quot;numpad-6&quot;)
	draw_string_Helvetica_10(x1+130, 445, &quot;numpad-7&quot;)
	draw_string_Helvetica_10(x1+230, 445, &quot;numpad-8&quot;)
	--------------------------------------------------------
	draw_string_Helvetica_10(x1+9, 345, &quot;numpad&quot;)
	draw_string_Helvetica_10(x1+20, 332, &quot;-9&quot;)
	draw_string_Helvetica_10(x1+59, 345, &quot;numpad&quot;)
	draw_string_Helvetica_10(x1+67, 332, &quot;-10&quot;)
	draw_string_Helvetica_10(x1+130, 345, &quot;numpad-11&quot;)
	draw_string_Helvetica_10(x1+209, 345, &quot;numpad&quot;)
	draw_string_Helvetica_10(x1+217, 332, &quot;-12&quot;)
	draw_string_Helvetica_10(x1+259, 345, &quot;numpad&quot;)
	draw_string_Helvetica_10(x1+267, 332, &quot;-13&quot;)
	--------------------------------------------------------
	draw_string_Helvetica_10(x1+25, 245, &quot;numpad-14&quot;)
	draw_string_Helvetica_10(x1+125, 245, &quot;numpad-15&quot;)
	draw_string_Helvetica_10(x1+225, 245, &quot;numpad-16&quot;)
	--------------------------------------------------------
	draw_string_Helvetica_10(x1+25, 145, &quot;numpad-17&quot;)
	draw_string_Helvetica_10(x1+125, 145, &quot;numpad-18&quot;)
	draw_string_Helvetica_10(x1+225, 145, &quot;numpad-19&quot;)

	--------------------------------------------------------
	--quick_lookボタンのスペースにマウスが乗ったときの色の変化
	--------------------------------------------------------
	graphics.set_color(0, 1, 0, 0.2)	--長方形の色（薄いきみどり）、透明度
	--------------------------------------------------------
	-- quick_look_0
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; y1*6 and MOUSE_Y &lt; y1*7-10 then	--この範囲にマウスが入ったら
		graphics.draw_rectangle(x1, y1*6, x1+100, y1*7)	--長方形を描く
	end
	-- quick_look_1
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; y1*6 and MOUSE_Y &lt; y1*7-10 then
		graphics.draw_rectangle(x1+100, y1*6, x1+200, y1*7)
	end
	-- quick_look_2
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; y1*6 and MOUSE_Y &lt; y1*7-10 then
		graphics.draw_rectangle(x1+200, y1*6, x1+300, y1*7)
	end
	--------------------------------------------------------
	-- quick_look_3
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; y1*5 and MOUSE_Y &lt; y1*6-10 then	--この範囲にマウスが入ったら
		graphics.draw_rectangle(x1, y1*5, x1+100, y1*6)	--長方形を描く
	end
	-- quick_look_4
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; y1*5 and MOUSE_Y &lt; y1*6-10 then
		graphics.draw_rectangle(x1+100, y1*5, x1+200, y1*6)
	end
	-- quick_look_5
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; y1*5 and MOUSE_Y &lt; y1*6-10 then
		graphics.draw_rectangle(x1+200, y1*5, x1+300, y1*6)
	end
	--------------------------------------------------------
	-- quick_look_6
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; y1*4 and MOUSE_Y &lt; y1*5-10 then
		graphics.draw_rectangle(x1, y1*4, x1+100, y1*5)
	end
	-- quick_look_7
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; y1*4 and MOUSE_Y &lt; y1*5-10 then
		graphics.draw_rectangle(x1+100, y1*4, x1+200, y1*5)
	end
	-- quick_look_8
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; y1*4 and MOUSE_Y &lt; y1*5-10 then
		graphics.draw_rectangle(x1+200, y1*4, x1+300, y1*5)
	end
	--------------------------------------------------------
	-- quick_look_9
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; y1*3 and MOUSE_Y &lt; y1*4-10 then
		graphics.draw_rectangle(x1, y1*3, x1+50, y1*4)
	end
	-- quick_look_10
	if MOUSE_X &gt; x1+50 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; y1*3 and MOUSE_Y &lt; y1*4-10 then
		graphics.draw_rectangle(x1+50, y1*3, x1+100, y1*4)
	end
	-- quick_look_11
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; y1*3 and MOUSE_Y &lt; y1*4-10 then
		graphics.set_color(1, 1, 0, 0.3)	--長方形の色（薄い黄色）、透明度
		graphics.draw_rectangle(x1+100, y1*3, x1+200, y1*4)
	end

	-- quick_look_12
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; y1*3 and MOUSE_Y &lt; y1*4-10 then
		graphics.draw_rectangle(x1+200, y1*3, x1+250, y1*4)
	end
	-- quick_look_13
	if MOUSE_X &gt; x1+250 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; y1*3 and MOUSE_Y &lt; y1*4-10 then
		graphics.draw_rectangle(x1+250, y1*3, x1+300, y1*4)
	end
	--------------------------------------------------------
	-- quick_look_14
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; y1*2 and MOUSE_Y &lt; y1*3-10 then
		graphics.draw_rectangle(x1, y1*2, x1+100, y1*3)
	end
	-- quick_look_15
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; y1*2 and MOUSE_Y &lt; y1*3-10 then
		graphics.draw_rectangle(x1+100, y1*2, x1+200, y1*3)
	end
	-- quick_look_16
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; y1*2 and MOUSE_Y &lt; y1*3-10 then
		graphics.draw_rectangle(x1+200, y1*2, x1+300, y1*3)
	end
	--------------------------------------------------------
	-- quick_look_17
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; y1*1 and MOUSE_Y &lt; y1*2-10 then
		graphics.draw_rectangle(x1, y1*1, x1+100, y1*2)
	end
	-- quick_look_18
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; y1*1 and MOUSE_Y &lt; y1*2-10 then
		graphics.draw_rectangle(x1+100, y1*1, x1+200, y1*2)
	end
	-- quick_look_19
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; y1*1 and MOUSE_Y &lt; y1*2-10 then
		graphics.draw_rectangle(x1+200, y1*1, x1+300, y1*2)
	end
	--------------------------------------------------------



	--------------------------------------------------------------
	-- 記憶ボタン quick_look_mem 黄緑の描写とマスを置いた時の色の変化
	--------------------------------------------------------------
	-- quick_look_0_mem
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; y1+590 and MOUSE_Y &lt; y1+600 then	--この範囲にマウスが入ったら
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1, y1+585, x1+50, y1+600)	--長方形を描く
	-- quick_look_1_mem
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; y1+590 and MOUSE_Y &lt; y1+600 then	--この範囲にマウスが入ったら
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+100, y1+585, x1+150, y1+600)	--長方形を描く
	-- quick_look_2_mem
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; y1+590 and MOUSE_Y &lt; y1+600 then	--この範囲にマウスが入ったら
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+200, y1+585, x1+250, y1+600)	--長方形を描く
	--------------------------------------------------------
	-- quick_look_3_mem
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; y1+490 and MOUSE_Y &lt; y1+500 then	--この範囲にマウスが入ったら
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1, y1+485, x1+50, y1+500)	--長方形を描く
	-- quick_look_4_mem
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; y1+490 and MOUSE_Y &lt; y1+500 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+100, y1+485, x1+150, y1+500)
	-- quick_look_5_mem
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; y1+490 and MOUSE_Y &lt; y1+500 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+200, y1+485, x1+250, y1+500)
	--------------------------------------------------------
	-- quick_look_6_mem
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; y1+390 and MOUSE_Y &lt; y1+400 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1, y1+385, x1+50, y1+400)
	-- quick_look_7_mem
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; y1+390 and MOUSE_Y &lt; y1+400 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+100, y1+385, x1+150, y1+400)
	-- quick_look_8_mem
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; y1+390 and MOUSE_Y &lt; y1+400 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+200, y1+385, x1+250, y1+400)
	--------------------------------------------------------
	-- quick_look_9_mem
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; y1+290 and MOUSE_Y &lt; y1+300 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1, y1+285, x1+50, y1+300)
	-- quick_look_10_mem
	if MOUSE_X &gt; x1+50 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; y1+290 and MOUSE_Y &lt; y1+300 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+50, y1+285, x1+100, y1+300)
	-- quick_look_11_mem
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; y1+290 and MOUSE_Y &lt; y1+300 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+100, y1+285, x1+150, y1+300)

	-- quick_look_12_mem
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; y1+290 and MOUSE_Y &lt; y1+300 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+200, y1+285, x1+250, y1+300)
	-- quick_look_13_mem
	if MOUSE_X &gt; x1+250 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; y1+290 and MOUSE_Y &lt; y1+300 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+250, y1+285, x1+300, y1+300)
	--------------------------------------------------------
	-- quick_look_14_mem
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; y1+190 and MOUSE_Y &lt; y1+200 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1, y1+185, x1+50, y1+200)

	-- quick_look_15_mem
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; y1+190 and MOUSE_Y &lt; y1+200 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+100, y1+185, x1+150, y1+200)
	-- quick_look_16_mem
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; y1+190 and MOUSE_Y &lt; y1+200 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+200, y1+185, x1+250, y1+200)
	--------------------------------------------------------
	-- quick_look_17_mem
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; 190 and MOUSE_Y &lt; 200 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1, 185, x1+50, 200)
	-- quick_look_18_mem
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; 190 and MOUSE_Y &lt; 200 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+100, 185, x1+150, 200)
	-- quick_look_19_mem
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; 190 and MOUSE_Y &lt; 200 then
		graphics.set_color(0, 1, 0, 0.8)	--長方形の色（きみどり）、透明度
	else
		graphics.set_color(0, 1, 0, 0.2)
	end
	graphics.draw_rectangle(x1+200, 185, x1+250, 200)
	--------------------------------------------------------

	--------------------------------------------
	-- 記憶ボタン（黄緑）のテキスト
	--------------------------------------------
	graphics.set_color(1, 1, 1, 1)
	--------------------------------------------
	draw_string_Helvetica_10(x1+8, 689, &quot;Memory&quot;)		--nompad-0 用
	draw_string_Helvetica_10(x1+108, 689, &quot;Memory&quot;)	--nompad-1 用
	draw_string_Helvetica_10(x1+208, 689, &quot;Memory&quot;)	--nompad-2 用
	--------------------------------------------
	draw_string_Helvetica_10(x1+8, 589, &quot;Memory&quot;)		--nompad-3 用
	draw_string_Helvetica_10(x1+108, 589, &quot;Memory&quot;)	--nompad-4 用
	draw_string_Helvetica_10(x1+208, 589, &quot;Memory&quot;)	--nompad-5 用
	--------------------------------------------
	draw_string_Helvetica_10(x1+8, 489, &quot;Memory&quot;)		--nompad-6 用
	draw_string_Helvetica_10(x1+108, 489, &quot;Memory&quot;)	--nompad-7 用
	draw_string_Helvetica_10(x1+208, 489, &quot;Memory&quot;)	--nompad-8 用
	--------------------------------------------
	draw_string_Helvetica_10(x1+8, 389, &quot;Memory&quot;)		--nompad-9 用
	draw_string_Helvetica_10(x1+58, 389, &quot;Memory&quot;)		--nompad-10 用
	draw_string_Helvetica_10(x1+108, 389, &quot;Memory&quot;)	--nompad-11 用
	draw_string_Helvetica_10(x1+208, 389, &quot;Memory&quot;)	--nompad-12 用
	draw_string_Helvetica_10(x1+258, 389, &quot;Memory&quot;)	--nompad-13 用
	--------------------------------------------
	draw_string_Helvetica_10(x1+8, 289, &quot;Memory&quot;)		--nompad-14 用
	draw_string_Helvetica_10(x1+108, 289, &quot;Memory&quot;)	--nompad-15 用
	draw_string_Helvetica_10(x1+208, 289, &quot;Memory&quot;)	--nompad-16 用
	--------------------------------------------
	draw_string_Helvetica_10(x1+8, 189, &quot;Memory&quot;)		--nompad-17 用
	draw_string_Helvetica_10(x1+108, 189, &quot;Memory&quot;)	--nompad-18 用
	draw_string_Helvetica_10(x1+208, 189, &quot;Memory&quot;)	--nompad-19 用
	--------------------------------------------

	--------------------------------------------
	-- ビュー（外側）のテキスト
	--------------------------------------------
	graphics.set_color(1, 1, 1, 1)
	--------------------------------------------
	draw_string_Helvetica_10(x1+310, 684, &quot;Fixed display&quot;)		--nompad-0 用
	draw_string_Helvetica_10(x1+310, 659, &quot;Single point display&quot;)	--nompad-1 用
	draw_string_Helvetica_10(x1+310, 634, &quot;Runway&quot;)	--nompad-2 用
	draw_string_Helvetica_10(x1+310, 609, &quot;Around the fuselage&quot;)		--nompad-3 用
	--------------------------------------------
	draw_string_Helvetica_10(x1+310, 584, &quot;Trackingk&quot;)	--nompad-4 用
	draw_string_Helvetica_10(x1+310, 559, &quot;Control tower&quot;)	--nompad-5 用
	draw_string_Helvetica_10(x1+310, 534, &quot;On board&quot;)		--nompad-6 用
	draw_string_Helvetica_10(x1+310, 509, &quot;Weapon tracking&quot;)	--nompad-7 用
	--------------------------------------------
	draw_string_Helvetica_10(x1+310, 484, &quot;Free camera&quot;)	--nompad-8 用
	draw_string_Helvetica_10(x1+310, 459, &quot;A&quot;)		--nompad-9 用
	draw_string_Helvetica_10(x1+310, 434, &quot;B&quot;)		--nompad-10 用
	draw_string_Helvetica_10(x1+310, 409, &quot;C&quot;)	--nompad-11 用X-Plane view
	--------------------------------------------
	draw_string_Helvetica_10(x1+310, 384, &quot;A&quot;)
	draw_string_Helvetica_10(x1+310, 359, &quot;B&quot;)
	draw_string_Helvetica_10(x1+310, 334, &quot;C&quot;)
	draw_string_Helvetica_10(x1+310, 309, &quot;D&quot;)
	--------------------------------------------
	draw_string_Helvetica_10(x1+310, 284, &quot;A&quot;)
	draw_string_Helvetica_10(x1+310, 259, &quot;B&quot;)
	draw_string_Helvetica_10(x1+310, 234, &quot;C&quot;)
	draw_string_Helvetica_10(x1+310, 209, &quot;D&quot;)
	--------------------------------------------
	draw_string_Helvetica_10(x1+310, 184, &quot;A&quot;)
	draw_string_Helvetica_10(x1+310, 159, &quot;B&quot;)
	draw_string_Helvetica_10(x1+310, 134, &quot;C&quot;)
	draw_string_Helvetica_10(x1+310, 109, &quot;replay toggle&quot;)
	--------------------------------------------



	-------------------------------------------------
	-- ビュー（外側）マウスクリック変化
	-------------------------------------------------
	graphics.set_color(0, 1, 0, 0.2)
	-------------------------------------------------
	-- No.1
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 675 and MOUSE_Y &lt; 700 then
		graphics.draw_rectangle(x1+300, 675, x1+350, 700)
	end
	-- No.2
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 650 and MOUSE_Y &lt; 675 then
		graphics.draw_rectangle(x1+300, 650, x1+350, 675)
	end
	-- No.3
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 625 and MOUSE_Y &lt; 650 then
		graphics.draw_rectangle(x1+300, 625, x1+350, 650)
	end
	-- No.4
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 600 and MOUSE_Y &lt; 625 then
		graphics.draw_rectangle(x1+300, 600, x1+350, 625)
	end
	-------------------------------------------------
	-- No.5
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 575 and MOUSE_Y &lt; 600 then
		graphics.draw_rectangle(x1+300, 575, x1+350, 600)
	end
	-- No.6
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 550 and MOUSE_Y &lt; 575 then
		graphics.draw_rectangle(x1+300, 550, x1+350, 575)
	end
	-- No.7
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 525 and MOUSE_Y &lt; 550 then
		graphics.draw_rectangle(x1+300, 525, x1+350, 550)
	end
	-- No.8
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 500 and MOUSE_Y &lt; 525 then
		graphics.draw_rectangle(x1+300, 500, x1+350, 525)
	end
	-------------------------------------------------
	-- No.9
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 475 and MOUSE_Y &lt; 500 then
		graphics.draw_rectangle(x1+300, 475, x1+350, 500)
	end
	-- No.10
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 450 and MOUSE_Y &lt; 475 then
		graphics.draw_rectangle(x1+300, 450, x1+350, 475)
	end
	-- No.11
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 425 and MOUSE_Y &lt; 450 then
		graphics.draw_rectangle(x1+300, 425, x1+350, 450)
	end
	-- No.12
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 400 and MOUSE_Y &lt; 425 then
		graphics.draw_rectangle(x1+300, 400, x1+350, 425)
	end
	-------------------------------------------------
	-- No.13
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 375 and MOUSE_Y &lt; 400 then
		graphics.draw_rectangle(x1+300, 375, x1+350, 400)
	end
	-- No.14
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 350 and MOUSE_Y &lt; 375 then
		graphics.draw_rectangle(x1+300, 350, x1+350, 375)
	end
	-- No.15
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 325 and MOUSE_Y &lt; 350 then
		graphics.draw_rectangle(x1+300, 325, x1+350, 350)
	end
	-- No.16
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 300 and MOUSE_Y &lt; 325 then
		graphics.draw_rectangle(x1+300, 300, x1+350, 325)
	end
	-------------------------------------------------
	-- No.17
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 275 and MOUSE_Y &lt; 300 then
		graphics.draw_rectangle(x1+300, 275, x1+350, 300)
	end
	-- No.18
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 250 and MOUSE_Y &lt; 275 then
		graphics.draw_rectangle(x1+300, 250, x1+350, 275)
	end
	-- No.19
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 225 and MOUSE_Y &lt; 250 then
		graphics.draw_rectangle(x1+300, 225, x1+350, 250)
	end
	-- No.20
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 200 and MOUSE_Y &lt; 225 then
		graphics.draw_rectangle(x1+300, 200, x1+350, 225)
	end
	-------------------------------------------------
	-- No.21
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 175 and MOUSE_Y &lt; 200 then
		graphics.draw_rectangle(x1+300, 175, x1+350, 200)
	end
	-- No.22
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 150 and MOUSE_Y &lt; 175 then
		graphics.draw_rectangle(x1+300, 150, x1+350, 175)
	end
	-- No.23
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 125 and MOUSE_Y &lt; 150 then
		graphics.draw_rectangle(x1+300, 125, x1+350, 150)
	end
	-- No.24
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 100 and MOUSE_Y &lt; 125 then
		graphics.draw_rectangle(x1+300, 100, x1+350, 125)
	end
	-------------------------------------------------
end
do_every_draw(&quot;draw_quick_look_memory()&quot;)


--------------------------＊＊＊＊＊＊＊＊＊＊--------------------------
---------------------- マウスクリックの関数（機能）---------------------
--------------------------＊＊＊＊＊＊＊＊＊＊--------------------------
function qs_mouse_click_events()

	-- マウス押し下げで一度だけ反応します
	if MOUSE_STATUS ~= &quot;down&quot; then
		return
	end

	----------------------------------------------------------
	-- 記憶ボタン quick_look_mem のマウスクリック時のコマンド処理
	----------------------------------------------------------
	-- Memory（quick_look_0_mem）
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; 690 and MOUSE_Y &lt; 700 then	--この範囲にマウスが入ったら
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_0_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true	--X-Plaenに対してクリックは有効にならない。つまり上の指定スペースだけ。
	end
	-- Memory（quick_look_1_mem）
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; 690 and MOUSE_Y &lt; 700 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_1_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_2_mem）
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; 690 and MOUSE_Y &lt; 700 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_2_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	----------------------------------------------------------
	-- Memory（quick_look_3_mem）
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; 590 and MOUSE_Y &lt; 600 then	--この範囲にマウスが入ったら
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_3_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true	--X-Plaenに対してクリックは有効にならない。つまり上の指定スペースだけ。
	end
	-- Memory（quick_look_4_mem）
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; 590 and MOUSE_Y &lt; 600 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_4_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_5_mem）
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; 590 and MOUSE_Y &lt; 600 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_5_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	----------------------------------------------------------
	-- Memory（quick_look_6_mem）
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; 490 and MOUSE_Y &lt; 500 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_6_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_7_mem）
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; 490 and MOUSE_Y &lt; 500 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_7_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_8_mem）
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; 490 and MOUSE_Y &lt; 500 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_8_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	----------------------------------------------------------
	-- Memory（quick_look_9_mem）
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; 390 and MOUSE_Y &lt; 400 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_9_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_10_mem）
	if MOUSE_X &gt; x1+50 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; 390 and MOUSE_Y &lt; 400 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_10_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_11_mem）
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; 390 and MOUSE_Y &lt; 400 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_11_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_12_mem）
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; 390 and MOUSE_Y &lt; 400 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_12_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_13_mem）
	if MOUSE_X &gt; x1+250 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; 390 and MOUSE_Y &lt; 400 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_13_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	----------------------------------------------------------
	-- Memory（quick_look_14_mem）
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; 290 and MOUSE_Y &lt; 300 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_14_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_15_mem）
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; 290 and MOUSE_Y &lt; 300 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_15_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_16_mem）
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; 290 and MOUSE_Y &lt; 300 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_16_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	----------------------------------------------------------
	-- Memory（quick_look_17_mem）
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; 190 and MOUSE_Y &lt; 200 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_17_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_18_mem）
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; 190 and MOUSE_Y &lt; 200 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_18_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- Memory（quick_look_19_mem）
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; 190 and MOUSE_Y &lt; 200 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_19_mem&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	----------------------------------------------------------


	-------------------------------------------------
	-- 大きいボタン quick_look クリック時のコマンド処理
	-------------------------------------------------
	-- quick_look_0
	if MOUSE_X &gt; x1+50 and MOUSE_X &lt; x1+150 and MOUSE_Y &gt; 600 and MOUSE_Y &lt; 685 then	--この範囲にマウスが入ったら
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_0&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true	--X-Plaenに対してクリックは有効にならない。つまり上の指定スペースだけ。
	end
	-- quick_look_1
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; 600 and MOUSE_Y &lt; 685 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_1&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_2
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; 600 and MOUSE_Y &lt; 685 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_2&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------
	-- quick_look_3
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; 500 and MOUSE_Y &lt; 585 then	--この範囲にマウスが入ったら
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_3&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true	--X-Plaenに対してクリックは有効にならない。つまり上の指定スペースだけ。
	end
	-- quick_look_4
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; 500 and MOUSE_Y &lt; 585 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_4&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_5
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; 500 and MOUSE_Y &lt; 585 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_5&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------
	-- quick_look_6
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; 400 and MOUSE_Y &lt; 485 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_6&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_7
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; 400 and MOUSE_Y &lt; 485 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_7&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_8
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; 400 and MOUSE_Y &lt; 485 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_8&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------
	-- quick_look_9
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+50 and MOUSE_Y &gt; 300 and MOUSE_Y &lt; 385 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_9&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_10
	if MOUSE_X &gt; x1+50 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; 300 and MOUSE_Y &lt; 385 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_10&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_11
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; 300 and MOUSE_Y &lt; 385 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_11&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_12
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+250 and MOUSE_Y &gt; 300 and MOUSE_Y &lt; 385 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_12&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_13
	if MOUSE_X &gt; x1+250 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; 300 and MOUSE_Y &lt; 385 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_13&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------
	-- quick_look_14
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; 200 and MOUSE_Y &lt; 285 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_14&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_15
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; 200 and MOUSE_Y &lt; 285 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_15&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_16
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; 200 and MOUSE_Y &lt; 285 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_16&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------
	-- quick_look_17
	if MOUSE_X &gt; x1 and MOUSE_X &lt; x1+100 and MOUSE_Y &gt; 100 and MOUSE_Y &lt; 185 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_17&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_18
	if MOUSE_X &gt; x1+100 and MOUSE_X &lt; x1+200 and MOUSE_Y &gt; 100 and MOUSE_Y &lt; 185 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_18&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-- quick_look_19
	if MOUSE_X &gt; x1+200 and MOUSE_X &lt; x1+300 and MOUSE_Y &gt; 100 and MOUSE_Y &lt; 185 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/quick_look_19&quot;)
		else
			command_once(&quot;sim/view/quick_look_11&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------





	-------------------------------------------------
	-- ビュー（外側）ボタンクリック
	-------------------------------------------------
	-- No.1 固定表示
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 675 and MOUSE_Y &lt; 700 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/linear_spot&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.2
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 650 and MOUSE_Y &lt; 675 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/still_spot&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.3
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 625 and MOUSE_Y &lt; 650 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/runway&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.4
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 600 and MOUSE_Y &lt; 625 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/circle&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------
	-- No.5
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 575 and MOUSE_Y &lt; 600 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/chase&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.6
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 550 and MOUSE_Y &lt; 575 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/tower&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.7
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 525 and MOUSE_Y &lt; 550 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/ridealong&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.8
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 500 and MOUSE_Y &lt; 525 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/track_weapon&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------
	-- No.9 free_camera
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 475 and MOUSE_Y &lt; 500 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;sim/view/free_camera&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.10
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 450 and MOUSE_Y &lt; 475 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.11
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 425 and MOUSE_Y &lt; 450 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;&quot;)
		end
	　RESUME_MOUSE_CLICK = true
	end
	-- No.12
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 400 and MOUSE_Y &lt; 425 then
		if MOUSE_STATUS == &quot;down&quot; then
			command_once(&quot;&quot;)
		end
		RESUME_MOUSE_CLICK = true
	end
	-------------------------------------------------
	-- No.13
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 375 and MOUSE_Y &lt; 400 then

	end
	-- No.14
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 350 and MOUSE_Y &lt; 375 then

	end
	-- No.15
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 325 and MOUSE_Y &lt; 350 then

	end
	-- No.16
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 300 and MOUSE_Y &lt; 325 then

	end
	-------------------------------------------------
	-- No.17
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 275 and MOUSE_Y &lt; 300 then

	end
	-- No.18
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 250 and MOUSE_Y &lt; 275 then

	end
	-- No.19
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 225 and MOUSE_Y &lt; 250 then

	end
	-- No.20
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 200 and MOUSE_Y &lt; 225 then

	end
	-------------------------------------------------
	-- No.21
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 175 and MOUSE_Y &lt; 200 then

	end
	-- No.22
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 150 and MOUSE_Y &lt; 175 then

	end
	-- No.23
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 125 and MOUSE_Y &lt; 150 then

	end
	-- No.24
	if MOUSE_X &gt; x1+300 and MOUSE_X &lt; x1+350 and MOUSE_Y &gt; 100 and MOUSE_Y &lt; 125 then
	if MOUSE_STATUS == &quot;down&quot; then
		command_once(&quot;sim/replay/replay_toggle&quot;)
	end
　RESUME_MOUSE_CLICK = true

	end
	-------------------------------------------------

end
do_on_mouse_click(&quot;qs_mouse_click_events()&quot;)	--上の関数マウスクリックをここで実行</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ビーコンライトスイッチをON/OFF</title>
		<link>https://polo-web.com/turn-the-beacon-light-switch-on-and-off/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Thu, 09 Oct 2025 02:14:53 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=16394</guid>

					<description><![CDATA[非常に簡単なスクリプトですが、スイッチボタンを作成してビーコンライトをコントロールします。以下の画像ではセスナのスイッチで実行しています。マウスを左下隅に持 …]]></description>
										<content:encoded><![CDATA[
<p>非常に簡単なスクリプトですが、スイッチボタンを作成してビーコンライトをコントロールします。以下の画像ではセスナのスイッチで実行しています。マウスを左下隅に持っていくとボタンが表示され、クリックするとスイッチが連動します。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="551" height="180" src="https://polo-web.com/wp-content/uploads/2025/10/540d79f0672a8a2d5b9a2_png-1.png" alt="" class="wp-image-16395" srcset="https://polo-web.com/wp-content/uploads/2025/10/540d79f0672a8a2d5b9a2_png-1.png 551w, https://polo-web.com/wp-content/uploads/2025/10/540d79f0672a8a2d5b9a2_png-1-300x98.png 300w" sizes="(max-width: 551px) 100vw, 551px" /></figure>



<p>ファイル名は半角英数字だったら、好きなように付けてください。<br>ここでは&nbsp;<strong>BeaconLightSwitch.lua</strong></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-lua" data-file="BeaconLightSwitch.lua" data-lang="Lua"><code>require &quot;graphics&quot;
local qs_beacon_light = dataref_table(&quot;sim/cockpit/electrical/beacon_lights_on&quot;)

function draw_quick_settings()
	-- マウスが反応するスペース。この範囲にマウスを持っていくとボタンが出てくる。
	if MOUSE_Y &gt; 100 or MOUSE_X &gt; 600 then
		return
	end
	
	-- グラフィックシステムを初期化する
	XPLMSetGraphicsState(0,0,0,1,1,0,0)

	-- カラースイッチ情報を描画（ビーコンライトをON/OFFしたときの色）
	if qs_beacon_light[0] == 0 then
		graphics.set_color(1, 1, 0, 1)	--イエロー
	else
		graphics.set_color(0, 1, 0, 1)	--グリーン
	end
	graphics.draw_rectangle(0, 0, 40, 30)	--ビーコンの色範囲を描く
	
	-- 情報テキストを描く
	graphics.set_color(0, 0, 0, 1)	--黒
	draw_string_Helvetica_10(5, 17, &quot;Beacon&quot;)
	draw_string_Helvetica_10(8, 5, &quot;Light&quot;)
end
do_every_draw(&quot;draw_quick_settings()&quot;)

-- マウスをクリックしたときの動作を設定
function qs_mouse_click_events()
	-- 一度だけ反応します
	if MOUSE_STATUS ~= &quot;down&quot; then
		return
	end
	-- ビーコンライトのON/OFF
	if MOUSE_X &lt; 40 and MOUSE_Y &lt; 30 then
		if qs_beacon_light[0] == 0 then
			qs_beacon_light[0] = 1
		else
			qs_beacon_light[0] = 0
		end
		RESUME_MOUSE_CLICK = true
	end
end

do_on_mouse_click(&quot;qs_mouse_click_events()&quot;)</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>FlyWithLua &#038; X-Plane</title>
		<link>https://polo-web.com/flywithlua-x-plane-2/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Thu, 09 Oct 2025 02:08:56 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=16392</guid>

					<description><![CDATA[FlyWithLuaを使うことによってX-Planeのさまざまなコントロールを可能します。作成したプラグインは非常に軽快に動作します。X-Planeの画面に …]]></description>
										<content:encoded><![CDATA[
<p>FlyWithLuaを使うことによってX-Planeのさまざまなコントロールを可能します。作成したプラグインは非常に軽快に動作します。X-Planeの画面に直接表示されるので邪魔ではないかと思われがちですが、必要なときだけ表示するようにすれば便利なプラグインになると思います。</p>



<h3 class="wp-block-heading">⚪️ FlyWuthLuaのインストール</h3>



<p>ダウンロードはここから：<a href="https://forums.x-plane.org/files/file/38445-flywithlua-ng-next-generation-edition-for-x-plane-11-win-lin-mac/">FlyWithLua NG (Next Generation) Edition for X-Plane 11</a>　<br><br>プラグインを使用するには、FlyWithLuaをフォルダー毎、X-Planeのpluginsフォルダーにコピーするだけです。結果次のようになります。<br>/X-Plane 11/Resources/plugins/FlyWithLua/Scripts/<br>作成したファイルをこの「Scripts」内に入れるだけです。</p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>draw_stringで複数行のテキストを表示 &#8211; FlyWithLua</title>
		<link>https://polo-web.com/display-multi-line-text-with-draw_string-flywithlua/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Wed, 27 Aug 2025 00:38:28 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=15017</guid>

					<description><![CDATA[draw_string()では基本1行しか表示できない。以下のようにするにはテーブルを使う必要がある。 「i」が「list」のテーブル数、valueがテーブ …]]></description>
										<content:encoded><![CDATA[
<p>draw_string()では基本1行しか表示できない。以下のようにするにはテーブルを使う必要がある。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/03/4c196aaf8356f68a109e6672d5b026c3.png" alt="" class="wp-image-10728"/></figure>
</div>


<p>「i」が「list」のテーブル数、valueがテーブルのテキスト。<br>draw_stringの3番目にテーブルのテキストが上のように自動的に入ることになる。逆に下から入ることに注意が必要。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>function Text_draw()
	list = {&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;}
	for i,value in ipairs(list) do
    		draw_string( 100, 90+(10*i), i .. &quot;:&quot; .. value, 0, 1, 0)
	end
end
do_every_draw(&quot;Text_draw()&quot;)</code></pre></div>



<h2 class="wp-block-heading">こういう方法もある</h2>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/03/4c196aaf8356f68a109e6672d5b026c3-1.png" alt="" class="wp-image-10729"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>function Text_draw()
  arr = {&quot;赤&quot;,&quot;黄&quot;,&quot;青&quot;}
  for i = 1 , #arr do
  	draw_string( 100, 90+(10*i), arr[i], 0, 1, 0)
  end
end
do_every_draw(&quot;Text_draw()&quot;)</code></pre></div>



<h2 class="wp-block-heading">上から順番にテキスト表示する</h2>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/03/X-System-5.png" alt="" class="wp-image-10731"/></figure>
</div>


<p>3行目、iにマイナスを付けているのが味噌。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>function Text_draw()
	for i = 1, 5, 1 do
		draw_string(100, 90 + (10 * -i), i, 0, 1, 0)	--「 −１」で上から下に表示されるようになる。
	end
end

do_every_draw(&quot;Text_draw()&quot;)</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>imgui ドローイングの作成 &#8211; FlyWithLua</title>
		<link>https://polo-web.com/imgui-create-drawings-flywithlua/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Sun, 31 Aug 2025 23:31:13 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=15092</guid>

					<description><![CDATA[-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。 draw_wnd = float_wnd_create( …]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter" id="block-3ba55edb-03ee-48a5-a5be-b43380fdb39b"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/3d139ba9c557e2f005632778c3a8abd0-20.png" alt="画像に alt 属性が指定されていません。ファイル名: 3d139ba9c557e2f005632778c3a8abd0-20.png"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="Draw.lua"><code>-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
draw_wnd = float_wnd_create(200, 100, 1, true)
float_wnd_set_title(draw_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(draw_wnd, &quot;draw_demo&quot;)
float_wnd_set_onclose(draw_wnd, &quot;closed_demo&quot;)


function draw_demo(wnd, x, y)
    local cx, cy = imgui.GetCursorScreenPos()   --ポジション設定用
        
    -- サイズ 100x100 の一種のキャンバスを作成します。
    -- 前の変数はキャンバスの左上端を記憶しているので、相対座標として使用して、絶対座標を使用してウィジェット内に描画できます。
    imgui.Dummy(100, 100)
    
    -- 斜めのラインを２つばつ印を作成、Parameters: x1、y1、x2、y2、色、厚さ
    imgui.DrawList_AddLine(cx, cy, cx + 20, cy + 20, 0xFF0000FF, 2)
    imgui.DrawList_AddLine(cx, cy + 20, cx + 20, cy, 0xFF0000FF, 2)
    
    -- 四角の線、Prameters: x1、y1、x2、y2、色、丸み（0.5もできる）太さが設定できない
    imgui.DrawList_AddRect(cx, cy, cx + 20, cy + 20, 0xFFFF0000, 0.5)

    -- 四角のベタ、Prameters: x1、y1、x2、y2、色、丸み
    imgui.DrawList_AddRectFilled(cx + 30, cy, cx + 50, cy + 20, 0xFFFF0000, 3)

    -- 三角の線、Parameters: x1、y1、x2、y2、x3、y3、色、太さ
    imgui.DrawList_AddTriangle(cx, cy + 60, cx + 40, cy + 60, cx + 20, cy + 30, 0xFF00FF00, 2.0)

    -- 三角のベタ、Parameters: x1, y1, x2, y2, x3, y3, color
    imgui.DrawList_AddTriangleFilled(cx + 50, cy + 60, cx + 90, cy + 60, cx + 50, cy + 30, 0xFF00FF00)

    -- 外の線の丸、Parameters: x1、y1、r、色、セグメント、厚さ
    imgui.DrawList_AddCircle(cx + 150, cy + 20, 20, 0xFF00FF00, 20, 1.0)

    -- 中のベタの丸、Parameters: x1, y1, r, color
    imgui.DrawList_AddCircleFilled(cx + 150, cy + 20, 10, 0xFF00FF00)
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>imgui イメージ（画像）の作成 – FlyWithLua</title>
		<link>https://polo-web.com/imgui-create-an-image-flywithlua/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Mon, 01 Sep 2025 00:34:26 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=15094</guid>

					<description><![CDATA[pngも読み込める。 -- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。 draw_wnd = float_ …]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/X-System-36.png" alt="" class="wp-image-10354"/></figure>
</div>


<p>pngも読み込める。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="image.lua"><code>-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
draw_wnd = float_wnd_create(250, 150, 1, true)
float_wnd_set_title(draw_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(draw_wnd, &quot;draw_demo&quot;)
float_wnd_set_onclose(draw_wnd, &quot;closed_demo&quot;)

-- imgui は画像の描画に対応しているので、読み込みましょう。 
-- スクリプトごとに一度だけロードされるように、イメージは常にグローバルにロードする必要があります。
image_id2 = float_wnd_load_image(SCRIPT_DIRECTORY .. &quot;/plane3.jpg&quot;)


function draw_demo(wnd, x, y)
    -- 読み込まれた画像を描画する
    imgui.Image(image_id2, 200, 110)
    -- Prameters: float_wnd_load_image によって返される画像 ID、表示幅、表示高さ
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>imgui リストボックスの作成 – FlyWithLua</title>
		<link>https://polo-web.com/imgui-creating-a-listbox-flywithlua/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Mon, 01 Sep 2025 01:36:14 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=15096</guid>

					<description><![CDATA[-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。 draw_wnd = float_wnd_create( …]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/X-System-37.png" alt="" class="wp-image-10357"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="List Box.lua"><code>-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
draw_wnd = float_wnd_create(250, 150, 1, true)
float_wnd_set_title(draw_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(draw_wnd, &quot;draw_demo&quot;)
float_wnd_set_onclose(draw_wnd, &quot;closed_demo&quot;)


function draw_demo(wnd, x, y)
    local choices = {&quot;Choice 1&quot;, &quot;Choice 2&quot;, &quot;Choice 3&quot;}
        
        -- BBeginListBox は、リスト ボックスを開始します。 
        -- 最初のパラメータはラベルで、2 番目のパラメータは現在選択されている選択肢のテキストです。
        if imgui.BeginListBox(&quot;List Box&quot;, choices[choice]) then
            -- すべての選択肢をループする
            for i = 1, #choices do
                -- Selectable 関数は、リストボックスに選択肢を追加します。
                -- 最初のパラメーターはラベル。この選択肢が現在選択されている場合、2 番目のパラメーターは true でなければなりません。
                if imgui.Selectable(choices[i], choice == i) then
                    -- Selectable は、新しい選択肢が選択されたときに true を返します。
                    -- その選択肢を選択変数にコピーする必要があります。
                    choice = i
                end
            end
            -- BeginListBox が true を返す場合、つまりリストボックスが現在開いている場合にのみ呼び出される必要があります。
            imgui.EndListBox()
        end
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>imgui Misc（寄せ集め）の作成 – FlyWithLua</title>
		<link>https://polo-web.com/imgui-misc-miscellaneous-creation-flywithlua/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Tue, 02 Sep 2025 00:00:28 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=15098</guid>

					<description><![CDATA[箇条書きでテキストを入れる 日本語はを入れると???で表示される。 -- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要が …]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="index-1">箇条書きでテキストを入れる</h2>



<p>日本語はを入れると???で表示される。</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/3d139ba9c557e2f005632778c3a8abd0-24.png" alt="" class="wp-image-10376"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="bullet.lua"><code>-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
bullet_wnd = float_wnd_create(200, 80, 1, true)
float_wnd_set_title(bullet_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(bullet_wnd, &quot;bullet_demo&quot;)
float_wnd_set_onclose(bullet_wnd, &quot;closed_demo&quot;)


function bullet_demo(wnd, x, y)
    -- 箇条書きスタイルの列挙を作成する
    imgui.Bullet(); imgui.TextUnformatted(&quot;Bulletあいう&quot;)
    imgui.Bullet(); imgui.TextUnformatted(&quot;Style&quot;)
    imgui.Bullet(); imgui.TextUnformatted(&quot;Enumeration&quot;)
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>



<h2 class="wp-block-heading" id="index-2">区切り線を入れる</h2>



<p>セパレーター（横の区切り線）、ウインドウの横一杯に入る。</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/3d139ba9c557e2f005632778c3a8abd0-25.png" alt="" class="wp-image-10377"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="separator.lua"><code>-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
separator_wnd = float_wnd_create(200, 80, 1, true)
float_wnd_set_title(separator_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(separator_wnd, &quot;separator_demo&quot;)
float_wnd_set_onclose(separator_wnd, &quot;closed_demo&quot;)


function separator_demo(wnd, x, y)
     -- 区切り線を引く
     imgui.Separator()
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>



<h2 class="wp-block-heading" id="index-3">プログレスバーの表示</h2>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/X-System-39.png" alt="" class="wp-image-10379"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
ProgressBar_wnd = float_wnd_create(300, 80, 1, true)
float_wnd_set_title(ProgressBar_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(ProgressBar_wnd, &quot;ProgressBar_demo&quot;)
float_wnd_set_onclose(ProgressBar_wnd, &quot;closed_demo&quot;)


function ProgressBar_demo(wnd, x, y)
     -- プログレスバーを表示、1 = 100%
     imgui.ProgressBar(0.5)
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>



<p></p>



<p></p>



<h2 class="wp-block-heading" id="index-4">ツールチップ（説明領域）の作成</h2>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/3d139ba9c557e2f005632778c3a8abd0-26.png" alt="" class="wp-image-10381"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="tooltip.lua"><code>-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
tooltip_wnd = float_wnd_create(200, 100, 1, true)
float_wnd_set_title(tooltip_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(tooltip_wnd, &quot;tooltip_demo&quot;)
float_wnd_set_onclose(tooltip_wnd, &quot;closed_demo&quot;)


function tooltip_demo(wnd, x, y)
    --まず、チェックボックスを作成
    _, makeRed = imgui.Checkbox(&quot;Complicated Item&quot;, makeRed)
    if imgui.IsItemActive() then
        -- アイテムがクリックされている間に説明流域が表示されるツールチップを作成できます。
        imgui.BeginTooltip()
        -- この関数は、ツールボックス内のラッピングを構成し、それによってその幅を構成します
        imgui.PushTextWrapPos(imgui.GetFontSize() * 10)
        imgui.TextUnformatted(&quot;Here&#39;s a long explanation text that describes the purpose of this widget&quot;)
        -- ラッピングをリセットします。これは、PushTextWrapPos を使用した場合は常に行う必要があります。
        imgui.PopTextWrapPos()
        imgui.EndTooltip()
    end
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>



<h2 class="wp-block-heading" id="index-5">ボタン等に同じ文字列を使う場合、誓約がある</h2>



<p>同じ名前で作成する場合、誓約があって使う場合注意が必要。</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/3d139ba9c557e2f005632778c3a8abd0-27.png" alt="" class="wp-image-10383"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
button_wnd = float_wnd_create(150, 200, 1, true)
float_wnd_set_title(button_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(button_wnd, &quot;button_demo&quot;)
float_wnd_set_onclose(button_wnd, &quot;closed_demo&quot;)


function button_demo(wnd, x, y)
    -- キャプション文字列は、ウィンドウ内で一つでなければならないことに注意してください! 
        -- 同じキャプション（Button）を持つ複数のウィジェットが必要な場合は、## の後に、非表示のキャプション拡張の一意の ID を追加します。
        imgui.Button(&quot;ButtonA##1&quot;)
        imgui.Button(&quot;ButtonA##2&quot;)
        
        -- 別のバリエーション: ループ内からウィジェットを作成する場合に備えて、PushID と PopID を使用してカスタム ID 名前空間を作成します。
        for i = 1, 5 do
            imgui.PushID(i)
            imgui.Button(&quot;ButtonB&quot;)
            imgui.PopID()
        end
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>io.open 保存したテキストファイルを読み込む &#8211; FlyWithLua</title>
		<link>https://polo-web.com/io-open-load-saved-text-file-flywithlua/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Tue, 02 Sep 2025 00:13:43 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=15100</guid>

					<description><![CDATA[テキストに保存されたファイル全てを一気に読み込み表示する。 ９行目で「SCRIPT_DIRECTORY..」つまり、FlWithLua内にあるscriptフ …]]></description>
										<content:encoded><![CDATA[
<p>テキストに保存されたファイル全てを一気に読み込み表示する。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/X-System-42.png" alt="" class="wp-image-10475"/></figure>
</div>


<p>９行目で「SCRIPT_DIRECTORY..」つまり、FlWithLua内にあるscriptフォルダ内にある「read.txt」に記述されたテキストの内容を読み込み表示することができる。<br>lineは全てのテキストを読み込むので、これでは行を指定して読み込むことはできない。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="read_text.lua"><code>-- imguiはフローティングウィンドウ内でのみ機能するため、最初に作成する必要があります。
demo_wnd = float_wnd_create(250, 150, 1, true)
float_wnd_set_title(demo_wnd, &quot;imgui Demo&quot;) --ウィンドウのタイトル
float_wnd_set_imgui_builder(demo_wnd, &quot;build_demo&quot;)
 
-- imguiウインドウ内で実行するスクリプト -------------------------------------------------
function build_demo(wnd, x, y)
 
  local file = io.open(SCRIPT_DIRECTORY..&quot;read.txt&quot;, &quot;r&quot;)   -- read.txtの内容を読み込む。
  for line in file:lines() do   --ファイル内にあるだけの行を読み込む
    --imguiでTextUnformattedはテキストを描く関数
    imgui.TextUnformatted(line)	--ここに上の「line」変数を読み込む
  end
 
  file:close() -- 最後にf:closeでファイルを閉じる
end</code></pre></div>



<h2 class="wp-block-heading">指定のテキストを読み込むことができる。</h2>



<p>テキストを用意する。読み込むテキストは区切りに「, 」を使う。最後の「, 」は入れない。入れると「,」が表示されてしまう。テキストはファイルの一番上から書き込む必要がある。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/03/read_txt.png" alt="" class="wp-image-10689"/></figure>
</div>


<p>実際に読み込んだら、このように最後に「,」が表示される。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/03/X-System-1.png" alt="" class="wp-image-10690"/></figure>
</div>


<p>上の状態のテキストなら、下のスクリプトで指定の文字を読み込む事ができる。<br>テキストの数と指定の数を合わせる必要がある。そうでないと表示されない。</p>



<p>txtLine_1, txtLine_2, txtLine_3 = string.match(line, &#8220;(.-)%,(.-)%,(.+)&#8221;)<br>string.matchは文字列をマッチさせる関数。&#8221;&#8221;内はマッチさせる方法、よくわからないが「, 」で区切られる内容をマッチさせているようだ。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>-- imguiはフローティングウィンドウ内でのみ機能するため、最初に作成する必要があります。
demo_wnd = float_wnd_create(250, 150, 1, true)
float_wnd_set_title(demo_wnd, &quot;imgui Demo&quot;) --ウィンドウのタイトル
float_wnd_set_imgui_builder(demo_wnd, &quot;build_demo&quot;)

-- imguiウインドウ内で実行するスクリプト -------------------------------------------------
function build_demo(wnd, x, y)
    local file = io.open(SCRIPT_DIRECTORY .. &quot;read.txt&quot;, &quot;r&quot;)
    for line in file:lines() do
        txtLine_1, txtLine_2, txtLine_3 = string.match(line, &quot;(.-)%,(.-)%,(.+)&quot;)
        imgui.TextUnformatted(txtLine_1)
        imgui.TextUnformatted(txtLine_2)
        imgui.TextUnformatted(txtLine_3)
    end
    file:close() -- 最後にf:closeでファイルを閉じる
end</code></pre></div>



<p>string.match(line, &#8220;(.-)%,(.-)%,(.+)&#8221;) この状態では最後に「,」を追加すると「,」が消える。<br>string.match(line, &#8220;(.-)%,(.-)%,(.+)<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ys-red-color">,</mark></strong>&#8220;) このように最後に赤の「,」を追加する。以下のように,が消えた。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/07/382b1fec2056eed19abc34ffadaa35b0.png" alt="" class="wp-image-12878"/></figure>
</div>


<h2 class="wp-block-heading">inputに読み込む</h2>



<p>imgui.TextUnformattedは読み込むことができたのでInputTextでも同じように読むことができる。ファイルは上と同じように「,」区切りである必要がある。最後の「,」を消す方法で作成している。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/07/X-System-2.png" alt="" class="wp-image-12635"/></figure>
</div>


<p>14行目の「string.match」で行を読み込む</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>-- imguiはフローティングウィンドウ内でのみ機能するため、最初に作成する必要があります。
demo_wnd = float_wnd_create(250, 150, 1, true)
float_wnd_set_title(demo_wnd, &quot;imgui Demo&quot;) --ウィンドウのタイトル
float_wnd_set_imgui_builder(demo_wnd, &quot;build_demo&quot;)

txtLine_1 = &quot;&quot;
txtLine_2 = &quot;&quot;
txtLine_3 = &quot;&quot;

-- imguiウインドウ内で実行するスクリプト -------------------------------------------------
function build_demo(wnd, x, y)
    local file = io.open(SCRIPT_DIRECTORY .. &quot;read.txt&quot;, &quot;r&quot;)
    for line in file:lines() do
        txtLine_1, txtLine_2, txtLine_3 = string.match(line, &quot;(.-)%,(.-)%,(.+),&quot;) --(.+)は最後の読み込みにに使う。
        imgui.TextUnformatted(txtLine_1)
        imgui.TextUnformatted(txtLine_2)
        imgui.TextUnformatted(txtLine_3)

        local changed, newText_1 = imgui.InputText(&quot;Text-1&quot;, txtLine_1, 255) -- パラメーター：ラベル、現在のテキスト、許可される最大文字数
        if changed then
            txtLine_1 = newText_1
        end
        local changed, newText_2 = imgui.InputText(&quot;Text-2&quot;, txtLine_2, 255) -- パラメーター：ラベル、現在のテキスト、許可される最大文字数
        if changed then
            txtLine_2 = newText_2
        end
        local changed, newText_3 = imgui.InputText(&quot;Text-3&quot;, txtLine_3, 255) -- パラメーター：ラベル、現在のテキスト、許可される最大文字数
        if changed then
            txtLine_3 = newText_3
        end
    end
    file:close() -- 最後にf:closeでファイルを閉じる
end</code></pre></div>



<h2 class="wp-block-heading">別パターンの読み込み方法</h2>



<p>こちらの方が簡単で理解しやすい。</p>



<p>書き出したファイルを読み込むことで、X-Planeを再起動しても表示を維持することができるようになる。<br>テキストファイルは改行で作成する。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/07/ff6bfd76a161b2d07cadfa1cf8c6caec-1.png" alt="" class="wp-image-12886"/></figure>
</div>


<p>15行〜20行で読み込んで、編集テキストを維持できるようになった。<br>と思ったが維持はできていない。リアルタイムに変更はできるが再起動すると内容はdata_2のテキストに変更されてしまう。つまり「line」は2行目のテキストを読み込んでいることになる。読み込みの方法が間違っていると思う。後で修正します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>if not SUPPORTS_FLOATING_WINDOWS then
    -- スクリプトが古いFlyWithLuaバージョンを停止しないようにするため
    logMsg(&quot;imgui not supported by your FlyWithLua version&quot;)
    return
end

local data_1 = &quot;&quot;--変数の数はio.openの数と必ず合わせる必要がある。
local data_2 = &quot;&quot;
local data_3 = &quot;&quot;
-- imguiはフローティングウィンドウ内でのみ機能するため、最初に作成する必要があります。
demo_wnd = float_wnd_create(200, 100, 1, true)
float_wnd_set_title(demo_wnd, &quot;imgui TextEdit_Demo&quot;)
float_wnd_set_imgui_builder(demo_wnd, &quot;build_demo&quot;)

--これによって編集テキストを維持できるようになった。
local backupfile = io.open(SCRIPT_DIRECTORY .. &quot;read.txt&quot;, &quot;r&quot;)
if backupfile ~= nil then --もしバックアップファイルが（nil）でない場合、つまり存在する場合。
    --以下の設定をするとテキストファイルにちゃんと記述されていないとウインドウ内のコンテンツが表示されなくる。
    bucontent = backupfile:lines() -- lines関数で行ごとに上から順番に読み込む
    data_1 = bucontent()           --1行目の読み込み
    data_2 = bucontent()           --２行目の読み込み
    data_3 = bucontent()

    backupfile:close()
end

--imguiでテキスト編集と編集したテキストを読み込み表示する関数
function build_demo(wnd, x, y)
    -- ユーザーがテキストを入力できるようにする。
    local changed, newText_1 = imgui.InputText(&quot;Text-1&quot;, data_1, 255) -- パラメーター：ラベル、現在のテキスト、許可される最大文字数
    if changed then
        data_1 = newText_1
    end
    local changed, newText_2 = imgui.InputText(&quot;Text-2&quot;, data_2, 255) -- パラメーター：ラベル、現在のテキスト、許可される最大文字数
    if changed then
        data_2 = newText_2
    end
    local changed, newText_3 = imgui.InputText(&quot;Text-3&quot;, data_3, 255) -- パラメーター：ラベル、現在のテキスト、許可される最大文字数
    if changed then
        data_3 = newText_3
    end

    local file = io.open(SCRIPT_DIRECTORY .. &quot;read.txt&quot;, &quot;w&quot;)
    file:write(data_1, &quot;\n&quot;)
    file:write(data_2, &quot;\n&quot;)
    file:write(data_3, &quot;\n&quot;)
    file:close()
end</code></pre></div>



<p>テストはしていないが、こんな方法もある</p>



<p>「if my_fp then」が余分に設定されている。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>local my_fp = io.open(SCRIPT_DIRECTORY .. &quot;hello.txt&quot;, &quot;w&quot;)
if my_fp then
	my_fp:write(&quot;Hello world&quot;)
	my_fp:close()
end</code></pre></div>



<h2 class="wp-block-heading">日本語を読み込む</h2>



<p>float_wnd_set_imgui_builderを使うと下のようには日本語を使えない。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/X-System-43.png" alt="" class="wp-image-10476"/></figure>
</div>


<p>このように日本語を使うには「float_wnd_set_ondraw()」を使う。テキスト読み込みは「draw_string」を使う必要がある。しかし、lineの行読み込みが１行になってしまう。何行かあるファイルを１行に重なって表示されてしまう。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>fwl_wnd = float_wnd_create(250, 150, 1, true)
float_wnd_set_title(fwl_wnd, &quot;imgui Demo&quot;)
float_wnd_set_ondraw(fwl_wnd, &quot;on_draw&quot;)

function on_draw(fwl_wnd, x, y)
 
  local file = io.open(SCRIPT_DIRECTORY..&quot;read.txt&quot;, &quot;r&quot;)   -- read.txtの内容を読み込む。
  for line in file:lines() do   --ファイル内にあるだけの行を読み込む
    draw_string(x + 10, y + 10, line, &quot;white&quot;)
  end
 
  file:close() -- 最後にf:closeでファイルを閉じる
end</code></pre></div>



<h2 class="wp-block-heading">\nのテキストが表示される問題</h2>



<p>ファイルから改行テキストを表示したいのだが、\nの文字がそのまま表示され改行されない。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>NSString* title = [NSString stringWithFormat:@&quot;%@\n%@&quot;, onemb, twomb];
[myButton setTitle:title forState: UIControlStateNormal];</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>let firstLine = &quot;first&quot;
let secondLine = &quot;second&quot;
let button = UIButton()
button.setTitle(firstLine + &quot;\n&quot; + secondLine, for: .normal)</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>imgui テキストをファイルに書き込む &#8211; FlyWithLua</title>
		<link>https://polo-web.com/imgui-write-text-to-file-flywithlua/</link>
		
		<dc:creator><![CDATA[polo-web]]></dc:creator>
		<pubDate>Tue, 02 Sep 2025 00:23:25 +0000</pubDate>
				<category><![CDATA[FlyWithLua]]></category>
		<guid isPermaLink="false">https://polo-web.com/?p=15102</guid>

					<description><![CDATA[指定の場所にテキストを書き出すことができる。最後に&#34;W&#34;が付く。 書き込みオプション io.open (&#34;filename&#038;q …]]></description>
										<content:encoded><![CDATA[
<p>指定の場所にテキストを書き出すことができる。最後に&#8221;W&#8221;が付く。</p>



<h2 class="wp-block-heading">書き込みオプション</h2>



<p>io.open (&#8220;filename&#8221;, &#8220;オプション&#8221;)</p>



<p>この関数は、文字列モードで指定されたモードでファイルを開きます。 新しいファイルハンドルを返します。エラーの場合は、nilとエラーメッセージを返します。</p>



<p>モード文字列は、次のいずれかになります。</p>



<ul class="wp-block-list">
<li>&#8220;r&#8221;：読み取りモード（デフォルト）。</li>



<li>&#8220;w&#8221;：書き込みモード。</li>



<li>&#8220;a&#8221;：追加モード。</li>



<li>&#8220;r+&#8221;：更新モード。以前のすべてのデータが保持されます。（書き込みができない）</li>



<li>&#8220;w+&#8221;：更新モード。以前のデータはすべて消去されます。（前のデータを消して書き直される）</li>



<li>&#8220;a+&#8221;：更新モードを追加します。以前のデータは保持され、書き込みはファイルの最後でのみ許可されます。（前のデータを残して、その後に書き込まれる）</li>
</ul>



<p>モード文字列の最後に「b」を付けることもできます。これは、一部のシステムでファイルをバイナリモードで開くために必要です。</p>



<h2 class="wp-block-heading">ファイルの書き出し先の指定</h2>



<p>X-Planeの最初のディレクトリに「TestWriteToFile.txt」ファイルが作成される。</p>



<p class="has-ys-light-gray-background-color has-background">file = io.open(&#8220;TestWriteToFile.txt&#8221;, &#8220;w&#8221;)</p>



<p>現在使用している機体のディレクトリに「TestWriteToFile.txt」ファイルが作成される。</p>



<p class="has-ys-light-gray-background-color has-background">file = io.open(AIRCRAFT_PATH..&#8221;TestWriteToFile.txt&#8221;, &#8220;w&#8221;)</p>



<p>X-Planeの中へのパスを自由に作成「TestWriteToFile.txt」ファイルが作成される。</p>



<p class="has-ys-light-gray-background-color has-background">local file = io.open (&#8220;/X-Plane 11/Resources/plugins/FlyWithLua/Scripts/missions.ini&#8221;,&#8221;W&#8221;)</p>



<p>Resourcesにluaファイルがあった場合のパスに「Tmissions.ini」ファイルが作成される。</p>



<p class="has-ys-green-color has-text-color has-link-color has-x-small-font-size wp-elements-66604e2f44358731a13a25868cf2b456">INIファイルは、ソフトウェアの設定などを記録するために用いられるファイル形式の一つ。構造は単純なテキストファイルであり、設定ファイルのフォーマットとしてよく使われる。INIとはinitialization（イニシャライゼーション）の略であり、その他にconfiguration（コンフィギュレーション）の略である「.CFG」や「.conf」、あるいは「.TXT」なども使われる。つまりはtxtと同じファイルということになる。</p>



<p class="has-ys-light-gray-background-color has-background">local file = io.open (&#8220;./Resources/plugins/FlyWithLua/Scripts/missions.ini&#8221;,&#8221;W&#8221;)</p>



<p>luaファイルがあった場所からのパスに「missions.ini」ファイルが作成される。</p>



<p class="has-ys-light-gray-background-color has-background">local file = io.open (SCRIPT_DIRECTORY .. &#8220;/missions.ini&#8221;,&#8221;W&#8221;)</p>



<p>Windowsの場合のパスの書き方</p>



<p class="has-ys-light-gray-background-color has-background">&#8220;Resources\plugins\FlyWithLua\Scripts\&#8221;</p>



<h2 class="wp-block-heading">全てのファイルを書き込む</h2>



<p>下のようにTest.txtファイルを自動で作成して、テキストを書き込む作業になる。ファイルはFlyWithLuaのscriptディレクトリに出力されて書き込まれる。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/Test_txt.png" alt="" class="wp-image-10479"/></figure>
</div>


<p>いかのファイル、不安定。書き込みがあったり、なかったり。<br>type別に書き込むことができるようだが&#8230;.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="writing_text.lua"><code>local Array1 = {
{&quot;Numbers&quot;,1,2,3,4,5},
{&quot;Strings&quot;,&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;},
{&quot;Booleans&quot;, true, false},
&quot;1234567890abcdefgh&quot;,
99,
true
}
 
local NewArray = { }
local write = true
 
function ArrayTest()
 
if write then
 
local file = io.open(SCRIPT_DIRECTORY..&quot;Test.txt&quot;, &quot;w&quot;) --Test.txtファイルを書き出す。
  --上のArray1をこのテキストに書き込む
    for i=1,#Array1 do
        if type(Array1[i]) == &quot;table&quot; then
            file:write(&quot;{&quot;) --このカッコも書き込む
            for l=1,#Array1[i] do --配列内にある行の数だけ書き込む
                if type(Array1[i][l]) == &quot;number&quot; then file:write(Array1[i][l]) end
                if type(Array1[i][l]) == &quot;string&quot; then file:write(&#39;&quot;&#39;..Array1[i][l]..&#39;&quot;&#39;) end
                if type(Array1[i][l]) == &quot;boolean&quot; then file:write(tostring(Array1[i][l])) end
                if l &lt; #Array1[i] then file:write(&quot;,&quot;) end
            end
            file:write(&quot;}\n&quot;) --改行する
        else
            for name,val in ipairs(Array1) do
                file:write(name,&quot; = &quot;,val)
                if i &lt; #Array1 then file:write(&quot;\n&quot;) end
            end
        end
    end
file:close()
write = false
 
end
end
do_often(&quot;ArrayTest()&quot;)</code></pre></div>



<p>上のコードの26行目ぐらいまでは理解できるが、その後の部分がわからない。</p>



<p>ここで重要なのは、名前を格納できないため、配列に名前を付けないことです。 代わりに、この配列が格納するものに関する識別子は、サブ配列の最初の値として保存されます。 したがって、「Numbers = {1,2,3,4,5}」の代わりに、「{&#8220;Numbers&#8221;,1,2,3,4,5}」と書く必要があります。 保存ファイルのどこにどの値が保存されているかが正確にわかっている場合、これは実際には必要ありませんが、デバッグに役立ちます。</p>



<p>ファイルから配列をロードするには、読み取りプロセス中に各行を分析する必要があります。配列の開始区切り文字として「{」、値区切り文字として各「,」、終了区切り文字として「}」を使用します。</p>



<h2 class="wp-block-heading">機体の名前を書き出す</h2>



<p>機体のフォルダー内に「Mysave.txt」ファイルが書き出され、機体の名前がその仲に記述され保存される。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" src="https://polo-web.com/WP/wp-content/uploads/2023/02/Mysave_txt.png" alt="" class="wp-image-10484"/></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>function writetofile()
        file = io.open(AIRCRAFT_PATH..&quot;Mysave.txt&quot;, &quot;w&quot;)
        file:write(&quot;-- File for: &quot;..AIRCRAFT_FILENAME..&quot; --\n&quot;) -- Write file header

        io.close(file)
end

do_often(&quot;writetofile()&quot;)</code></pre></div>



<h2 class="wp-block-heading">単純にテキストを書き込む（基本形）</h2>



<p>X-Planeの最初のディレクトリに自動的にtextファイルを作成して、datarefの値をその中に書き込む。</p>



<p>単純にテキストを指定して書き込む。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="588" height="301" src="https://polo-web.com/WP/wp-content/uploads/2023/06/X-Plane_11-1.png" alt="" class="wp-image-12586" srcset="https://polo-web.com/wp-content/uploads/2023/06/X-Plane_11-1.png 588w, https://polo-web.com/wp-content/uploads/2023/06/X-Plane_11-1-300x154.png 300w" sizes="(max-width: 588px) 100vw, 588px" /></figure>
</div>


<p>1、2行目のテキストが書き込まれる。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>data_1 = &quot;ABCD&quot;
data_2 = &quot;123457851&quot;

function data_test()
    file = io.open(&quot;dataTest.txt&quot;, &quot;w&quot;) --X-Planeの最初のディレクトリに自動的にファイルが作成され書き込まれて保存される。

    file:write(data_1, &quot;\n&quot;)
    file:write(data_2, &quot;\n&quot;)

    file:close()
end

do_every_frame(&quot;data_test()&quot;)</code></pre></div>



<h2 class="wp-block-heading">datarefの数値を取得して書き込む</h2>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="571" height="340" src="https://polo-web.com/WP/wp-content/uploads/2023/06/X-Plane_11.png" alt="" class="wp-image-12585" srcset="https://polo-web.com/wp-content/uploads/2023/06/X-Plane_11.png 571w, https://polo-web.com/wp-content/uploads/2023/06/X-Plane_11-300x179.png 300w" sizes="auto, (max-width: 571px) 100vw, 571px" /></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>-- open files
dataref(&quot;FMC01L&quot;, &quot;sim/cockpit2/radios/actuators/nav1_frequency_Mhz&quot;)
dataref(&quot;FMC01S&quot;, &quot;sim/cockpit2/radios/actuators/nav2_right_frequency_hz&quot;)

function PetlaFMC()
    file = io.open(&quot;DaneDoFMC.txt&quot;, &quot;w&quot;) --X-Planeの最初のディレクトリに自動的にファイルが作成され書き込まれて保存される。

    file:write(FMC01L, &quot;\n&quot;)
    file:write(FMC01S, &quot;\n&quot;)

    file:close()
end

do_every_frame(&quot;PetlaFMC()&quot;)</code></pre></div>



<h2 class="wp-block-heading">条件付きファイルで、自動的に飛行機がロードされるようにする</h2>



<p>おなじくdatarefを扱うが、機体を指定して書き出すファイル名を機体のファイル名にして出力する。<br>以下はC172を指定している。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="710" height="147" src="https://polo-web.com/WP/wp-content/uploads/2023/08/Scripts.png" alt="" class="wp-image-13298" srcset="https://polo-web.com/wp-content/uploads/2023/08/Scripts.png 710w, https://polo-web.com/wp-content/uploads/2023/08/Scripts-300x62.png 300w" sizes="auto, (max-width: 710px) 100vw, 710px" /></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>-- dataref  Variablen
local ap_altitude    = dataref_table(&quot;sim/cockpit/autopilot/altitude&quot;, &quot;writable&quot;)
local baro_setting   = dataref_table(&quot;sim/cockpit/misc/barometer_setting&quot;, &quot;writable&quot;)
local baro_setting2  = dataref_table(&quot;sim/cockpit/misc/barometer_setting2&quot;, &quot;writable&quot;)
local hobbs_time     = dataref_table(&quot;sim/time/hobbs_time&quot;, &quot;writable&quot;)

-- 機体ごとに異なるファイルを作成する
local planeref       = &quot;C172&quot;
--Windowsの場合
local hobbs_filename = &quot;Resources\\plugins\\FlyWithLua\\Scripts\\&quot; .. planeref .. &quot;_settings.txt&quot;
--Macの場合
local hobbs_filename = &quot;Resources/plugins/FlyWithLua/Scripts/&quot; .. planeref .. &quot;_settings.txt&quot; --planerefの中に機体名が入る

-- 目的の値でファイルを作成する関数
function save_hobbstime()
    local hobbsfile = io.open(hobbs_filename, &quot;w+&quot;)

    if (hobbsfile == nil) then                   --ファイルが空なら
        print(&quot;write error in save_hobbstime()&quot;) --Logファイルに出力さっる。save_hobbstime() での書き込みエラー
        return
    end

    hobbsfile:write(hobbs_time[0], &quot;\n&quot;)
    hobbsfile:write(baro_setting[0], &quot;\n&quot;)
    hobbsfile:write(baro_setting2[0], &quot;\n&quot;)
    hobbsfile:write(ap_altitude[0], &quot;\n&quot;)
    hobbsfile:close()
end

-- 上の関数を呼び出す
save_hobbstime()</code></pre></div>



<h2 class="wp-block-heading">imgui.InputTextでの入力テキストを書き込む</h2>



<p>InputTextを使ってテキストを入力して書き出す。<br>問題なくリアルタイムに書き出されるが、このままではX-Planeを再起動したり、FlyWithLuaを読み込み治すとテキストは消えてしまう。これは読み込みの機能が無いからである。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="758" height="294" src="https://polo-web.com/WP/wp-content/uploads/2023/06/35825db2e425437ff2286b41eaaf8229.png" alt="" class="wp-image-12589" srcset="https://polo-web.com/wp-content/uploads/2023/06/35825db2e425437ff2286b41eaaf8229.png 758w, https://polo-web.com/wp-content/uploads/2023/06/35825db2e425437ff2286b41eaaf8229-300x116.png 300w" sizes="auto, (max-width: 758px) 100vw, 758px" /></figure>
</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain" data-file="filename.lua"><code>demo_wnd = float_wnd_create(200, 100, 1, true)
float_wnd_set_title(demo_wnd, &quot;imgui Demo&quot;)
float_wnd_set_imgui_builder(demo_wnd, &quot;build_demo&quot;)
float_wnd_set_onclose(demo_wnd, &quot;closed_demo&quot;)

local data_1 = &quot;&quot;
local data_2 = &quot;&quot;

function build_demo(demo_wnd, x, y)
    file = io.open(&quot;dataTest.txt&quot;, &quot;w&quot;) --X-Planeの最初のディレクトリに自動的にファイルが作成され書き込まれて保存される。

    file:write(data_1, &quot;\n&quot;)
    file:write(data_2, &quot;\n&quot;)

    file:close()

    -- ユーザーがテキストを入力できるようにする。1行のみ。
    local changed, newText_1 = imgui.InputText(&quot;Text-1&quot;, data_1, 255)
    -- Parameters: ラベル、現在のテキスト、許可される最大文字数
    if changed then
        data_1 = newText_1
    end
    local changed, newText_2 = imgui.InputText(&quot;Text-2&quot;, data_2, 255)
    -- Parameters: ラベル、現在のテキスト、許可される最大文字数
    if changed then
        data_2 = newText_2
    end
end

function closed_demo(demo_wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
