<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Know Your Nodes on Godot 4 レシピ</title><link>https://kamera25.github.io/godot_recipes/4.x/kyn/index.html</link><description>Recent content in Know Your Nodes on Godot 4 レシピ</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://kamera25.github.io/godot_recipes/4.x/kyn/index.xml" rel="self" type="application/rss+xml"/><item><title>Label</title><link>https://kamera25.github.io/godot_recipes/4.x/kyn/label/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://kamera25.github.io/godot_recipes/4.x/kyn/label/index.html</guid><description>&lt;h2 id="hahahugoshortcode284s0hbhblabel"&gt;&lt;i class="gd-Label"&gt;&lt;/i&gt;&lt;code&gt;Label&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;i class="gd-Label"&gt;&lt;/i&gt;&lt;code&gt;Label&lt;/code&gt; is a &lt;i class="gd-Control"&gt;&lt;/i&gt;&lt;code&gt;Control&lt;/code&gt; node for displaying unformatted text, with options for controlling the text&amp;rsquo;s alignment, wrapping, etc.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.godotengine.org/en/stable/classes/class_label.html" target="_blank"&gt;API Documentation&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="node-properties"&gt;Node properties&lt;/h3&gt;
&lt;p&gt;See the documentation for the full list, but here we&amp;rsquo;ll review the most commonly used properties of the node:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;text&lt;/code&gt; - this property is the contents of the label. Change this in code to change what the label displays. If you&amp;rsquo;re displaying numerical values, don&amp;rsquo;t forget to convert them to strings! For example, to update a label with a given numerical value:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript" data-lang="gdscript"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;func&lt;/span&gt; &lt;span style="color:#88c0d0"&gt;update_label&lt;/span&gt;&lt;span style="color:#eceff4"&gt;(&lt;/span&gt;value&lt;span style="color:#eceff4"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $Label&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;text &lt;span style="color:#81a1c1"&gt;=&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;str&lt;/span&gt;&lt;span style="color:#eceff4"&gt;(&lt;/span&gt;value&lt;span style="color:#eceff4"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;align&lt;/code&gt; - this property allows you to align the text right/center/left.&lt;/p&gt;</description></item><item><title>Path2D &amp; PathFollow2D</title><link>https://kamera25.github.io/godot_recipes/4.x/kyn/path2d/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://kamera25.github.io/godot_recipes/4.x/kyn/path2d/index.html</guid><description>&lt;div class="box notices cstyle tip"&gt;
&lt;div class="box-label"&gt;&lt;i class="fa-fw fas fa-lightbulb"&gt;&lt;/i&gt; Tip&lt;/div&gt;
&lt;div class="box-content"&gt;
&lt;p&gt;This article is being updated from Godot 3 to Godot 4.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="hahahugoshortcode290s1hbhbpath2d--hahahugoshortcode290s2hbhb-pathfollow2d"&gt;&lt;i class="gd-Path2D"&gt;&lt;/i&gt;&lt;code&gt;Path2D &amp;amp; &lt;i class="gd-PathFollow2D"&gt;&lt;/i&gt; PathFollow2D&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;path&lt;/em&gt; is a sequence of points in 2D space, defined by a &lt;i class="gd-Curve2D"&gt;&lt;/i&gt;&lt;code&gt;Curve2D&lt;/code&gt; resource. The &lt;i class="gd-Path2D"&gt;&lt;/i&gt;&lt;code&gt;Path2D&lt;/code&gt; is a node that allows you to position a path in 2D space, and do create a new path in the editor.&lt;/p&gt;
&lt;p&gt;Paths have a variety of uses. You can make a patrol path for an enemy mob to follow, a winding path for an animated visual effect, a pattern for a moving platform to follow, etc.&lt;/p&gt;</description></item><item><title>RayCast2D</title><link>https://kamera25.github.io/godot_recipes/4.x/kyn/raycast2d/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://kamera25.github.io/godot_recipes/4.x/kyn/raycast2d/index.html</guid><description>&lt;div class="box notices cstyle tip"&gt;
&lt;div class="box-label"&gt;&lt;i class="fa-fw fas fa-lightbulb"&gt;&lt;/i&gt; Tip&lt;/div&gt;
&lt;div class="box-content"&gt;
&lt;p&gt;This article is being updated from Godot 3 to Godot 4.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="hahahugoshortcode296s1hbhbraycast2d"&gt;&lt;i class="gd-RayCast2D"&gt;&lt;/i&gt;RayCast2D&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Raycasting&lt;/em&gt; is a common technique in game development. &amp;ldquo;Casting a ray&amp;rdquo; means extending a line from a point until it collides with something or reaches its limit.&lt;/p&gt;
&lt;h3 id="node-properties"&gt;Node properties&lt;/h3&gt;
&lt;p&gt;Add a &lt;i class="gd-RayCast2D"&gt;&lt;/i&gt;&lt;code&gt;RayCast2D&lt;/code&gt; node and take a look at the Inspector:&lt;/p&gt;
&lt;p&gt;
&lt;a href="#image-4c8a6f556598b4fbcd285ee9cd25161c" class="lightbox-link"&gt;
&lt;img src="https://kamera25.github.io/godot_recipes/4.x/img/kyn_raycast2d_01_4.png" alt="alt" style="height: auto; width: auto;" loading="lazy"&gt;
&lt;/a&gt;
&lt;a href="javascript:history.back();" class="lightbox" id="image-4c8a6f556598b4fbcd285ee9cd25161c"&gt;
&lt;img src="https://kamera25.github.io/godot_recipes/4.x/img/kyn_raycast2d_01_4.png" alt="alt" class="lightbox-image" loading="lazy"&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here are the main properties you&amp;rsquo;ll need to understand:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Enabled&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Turn this off to disabled the raycast work.&lt;/p&gt;</description></item></channel></rss>