浏览代码

wip updating text - laptop

Jorn 3 年之前
父节点
当前提交
e7e337d64b
共有 2 个文件被更改,包括 24 次插入10 次删除
  1. 13 6
      en/tutorials/csharpintermediate/collision-triggers.md
  2. 11 4
      en/tutorials/csharpintermediate/ui-basics.md

+ 13 - 6
en/tutorials/csharpintermediate/collision-triggers.md

@@ -1,12 +1,19 @@
-# Delta Time
-You can find this sample in the tutorial project: **Menu** → **Delta Time** 
+# Collision trigger
 
 ## Explanation
-This C# Beginner tutorial covers the retrieval and usage of delta time. A games tries to update itself as often as possible. The amount of times it updates in a single second is called 'Frames Per Second' or shortened to 'FPS'. If we wanted to update a timer value, we would need a value that takes into account what the current amount of frames per second is. That is what delta time is used for. So whether your game runs 30 FPS or 120 FPS: you always want to have the same time scale.
+This C# intermediate tutorial covers the use of collision triggers. It teaches about rigid bodies and how to set those up in the editor.
 
-![Delta Time](media/deltatime.png)
+Rigid bodies determine how entites in our scene behave on gravity, whether they collider with other objects or in the case of this tutorial": trigger collision events in our code. We do this by setting up a collider box in our scene and letting a sphere roll through this object. The events that are triggered are then processed by the script that we will make for it.
 
-<iframe width="560" height="315" src="https://www.youtube.com/embed/WMGY8JOqzeE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
+![Collision triggers](media/collision-triggers.png)
+
+<iframe width="560" height="315" src="https://www.youtube.com/embed/TzwGe4RzAb4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
 
 ## Code
-[!code-csharp[DeltaTime](..\..\..\..\stride\samples\Tutorials\CSharpBeginner\CSharpBeginner\CSharpBeginner.Game\Code\DeltaTimeDemo.cs)]
+### Stride editor UI pages
+The code below will look for a Page component that has been added to the current entity. On that page we search for UI elements like buttons and textfields. We than tell those UI elements what happends when we click on them, or that something needs to be done when a text value changes.
+[!code-csharp[editorpages](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\02_Collision-Triggers/CollisionTriggerDemo.cs)]
+
+### UI pages made entirely by code
+This script will create everything from scratch: a UI page, a stackpanel, a button, a textfield and the interactive logic behind it.
+[!code-csharp[uibycode](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\01_UI-Basics\UIByCode)]

+ 11 - 4
en/tutorials/csharpintermediate/ui-basics.md

@@ -1,12 +1,19 @@
 # UI Basics
-You can find this sample in the tutorial project: **Menu** &rarr; **Removing entities** 
 
 ## Explanation
-This C# Beginner tutorial covers how to remove existing entities from the scene and how to remove an entity that is a child of another entity. When we add entities to the Scene root we can remove that entity again by accessing the scene.Entities property. Entities that are added as children of other entities can be removed by accessing the children of an entity. 
+This first C# intermediate tutorial covers the basiscs of creating UI with Stride. We will learn about the UI editor, accesing UI page elements and even how to setup UI entirely by code. The Stride editor comes with a UI editor which we can utilize to create UI pages. We can than add UI elements to these pages, like buttons and textfields.
 
-![Cloning entities](media/removing-entity.png)
+Those UI elements can be referenced in code, so that can set up events like "button-clicked" or "text-changed". 
+
+![Cloning entities](media/ui-basics.png)
 
 <iframe width="560" height="315" src="https://www.youtube.com/embed/TzwGe4RzAb4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
 
 ## Code
-[!code-csharp[Entity](..\..\..\..\stride\samples\Tutorials\CSharpBeginner\CSharpBeginner\CSharpBeginner.Game\Code\RemoveEntitiesDemo.cs)]
+### Stride editor UI pages
+The code below will look for a Page component that has been added to the current entity. On that page we search for UI elements like buttons and textfields. We than tell those UI elements what happends when we click on them, or that something needs to be done when a text value changes.
+[!code-csharp[editorpages](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\01_UI-Basics\UIByEditor.cs)]
+
+### UI pages made entirely by code
+This script will create everything from scratch: a UI page, a stackpanel, a button, a textfield and the interactive logic behind it.
+[!code-csharp[uibycode](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\01_UI-Basics\UIByCode)]