Table of Contents

C# Code Only Basic Examples

This page provides a brief overview of the basic examples available for code-only projects in Stride. You can explore each example in detail. Each linked example page contains detailed code snippets and explanations.

Examples Overview

  • Capsule with rigid body: Shows how to create a 3D capsule entity and position it in a scene.
  • Give me a cube: Presents a variation of the above example by positioning a 3D cube in a scene.
  • Mesh line: Shows how to create a mesh line.
  • Stride UI - Capsule with rigid body and Window: Shows how to create a 3D capsule entity, position it in a scene, and create a simple window displaying a text message.
  • Stride UI - Grid - Save and load game state: Shows how to create a simple game where clicking a cube increases the score and manages game state.
  • Material: Shows how to create a material and apply it to a 3D entity.
  • Procedural geometry: Shows how to create procedural geometry meshes—such as a triangle, plane, and circle—and add them to a scene.
  • Cylinder mesh: Shows how to create a cylinder mesh.
  • Partial torus mesh: Shows how to create a partial torus mesh.
  • Particles: Shows how to create a particle system.
  • Raycast: Shows how to implement raycasting and physics interactions.
  • Collision Group: Shows how to create a scene with two players and an enemy entity and set up collision groups.
  • Collision Layer: Shows how to create a scene with two players and an enemy entity and set up collision layers.

Interactive Console Application

For those who prefer a more interactive approach, we provide a console application that allows you to run these examples directly. This console app, available in the Stride.CommunityToolkit.Examples project, offers an interactive menu for selecting and running the examples.

Here's a glimpse of the interactive menu provided by the console application:

Stride Community Toolkit Examples

[1] Basic Example - Capsule with rigid body
[2] Basic Example - Capsule with rigid body in F#
[3] Basic Example - Capsule with rigid body in Visual Basic
[4] Basic Example - Mesh Line
[5] Basic Example - Material
[6] Basic Example - Give me a cube
[7] Basic Example - Stride UI - Canvas - Capsule with rigid body and Window
[8] Basic Example - Stride UI - Grid - Save and load game state
[9] Basic Example - Procedural Geometry
[10] Basic Example - Cylinder Mesh
[11] Basic Example - Partial Torus
[12] Basic Example - Partial Torus in F#
[13] Basic Example - Particles
[14] Basic Example - Raycast
[15] Basic Example - CollisionGroup
[16] Basic Example - CollisionLayer
[17] Advance Example - Simple Constraint
[18] Advance Example - Various Constraints
[19] Advance Example - Myra UI - Draggable Window, GetService()
[20] Advance Example - Stride UI - Draggable Window
[21] Advance Example - Image Processing
[22] Advance Example - Root Renderer Shader
[23] Other - Debug Shapes
[24] Other - Renderer
[Q] Quit

Enter choice and press ENTER to continue