|
@@ -14,6 +14,9 @@ Those UI elements can be referenced in code, so that can set up events like "but
|
|
|
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.
|
|
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)]
|
|
[!code-csharp[editorpages](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\01_UI-Basics\UIByEditor.cs)]
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+<iframe width="560" height="315" src="https://www.youtube.com/embed/NnnbHn9LQUU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
|
|
|
+
|
|
|
### UI pages made entirely by code
|
|
### 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.
|
|
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)]
|
|
[!code-csharp[uibycode](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\01_UI-Basics\UIByCode)]
|