-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhs_stride_editor_api_for_llms.txt
More file actions
636 lines (537 loc) · 26.6 KB
/
Copy pathhs_stride_editor_api_for_llms.txt
File metadata and controls
636 lines (537 loc) · 26.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
HS STRIDE EDITOR TOOLKIT - LLM API REFERENCE
==============================================
Version: 1.8.1 | .NET 8.0 | Package: HS.Stride.Editor.Toolkit
CRITICAL: File-based batch automation, NOT live editor scripting.
- Close Stride Editor before running scripts
- BACKUP your project - changes permanent on .Save()
- Reopen GameStudio to see changes
- Only serialized properties (visible in Property Grid) are accessible
- Prefab instances: Break link or edit prefab asset directly
================================================================================
STRIDEPROJECT (Entry Point)
================================================================================
Namespace: HS.Stride.Editor.Toolkit.Core
Constructor:
StrideProject(string projectPath, ProjectMode mode = ProjectMode.Strict)
- Strict: Validates properties exist in C# scripts (catches typos)
- Loose: Allows any property (no validation)
Properties:
string ProjectPath, string AssetsPath, ProjectMode Mode
Scene Methods:
Scene LoadScene(string nameOrPath)
Scene CreateScene(string name, string? relativePath = null)
Asset Loading (return editable asset objects):
MaterialAsset LoadMaterial(string nameOrPath)
TextureAsset LoadTexture(string nameOrPath)
AnimationAsset LoadAnimation(string nameOrPath)
ColliderShapeAsset LoadColliderShape(string nameOrPath)
PrefabAsset LoadPrefab(string nameOrPath)
UIPage LoadUIPage(string nameOrPath)
SoundAsset LoadSound(string nameOrPath)
SkeletonAsset LoadSkeleton(string nameOrPath)
SpriteSheetAsset LoadSpriteSheet(string nameOrPath)
EffectAsset LoadEffect(string nameOrPath)
Asset Finding (return AssetReference):
AssetReference? FindAsset(string name, AssetType? type = null)
List<AssetReference> FindAssets(string pattern, AssetType? type = null)
AssetReference? FindAssetByPath(string relativePath)
AssetReference? FindAssetByGuid(string guid)
Get All Assets:
List<AssetReference> GetScenes/GetPrefabs/GetModels/GetMaterials/GetTextures()
List<AssetReference> GetAnimations/GetSkeletons/GetSounds/GetUIPages()
List<AssetReference> GetSpriteSheets/GetEffects/GetScripts/GetAllAssets()
Utility:
void Rescan()
string? GetRawAssetSource(AssetReference rawAsset)
string? GetAssetSource(AssetReference asset)
ColliderShapeAsset CreateColliderShape(string modelRef, string name, string? relativePath = null)
Prefab CreatePrefab(string name, string? relativePath = null)
UIPage CreateUIPage(string name, string? relativePath = null)
================================================================================
SCENE
================================================================================
Namespace: HS.Stride.Editor.Toolkit.Core.SceneEditing
Static: Scene Load(string filePath)
Properties: string Id, string FilePath, List<Entity> AllEntities
Find Methods:
Entity? FindEntityById(string id)
Entity? FindEntityByName(string name)
List<Entity> FindEntitiesByName(string pattern) // wildcards: * ?
List<Entity> FindEntitiesWithComponent(string componentType)
List<Entity> FindEntities(Func<Entity, bool> predicate)
Entity Manipulation:
Entity CreateEntity(string name, string? folder = null)
Entity CreateEntity(string name, string parent, ParentType parentType)
Entity InstantiatePrefab(AssetReference prefab, Vector3Data? pos = null, string? folder = null)
void RemoveEntity(Entity entity)
void RemoveEntity(string entityId)
Persistence:
void Save()
void SaveAs(string filePath)
void Reload()
================================================================================
ENTITY
================================================================================
Namespace: HS.Stride.Editor.Toolkit.Core
Properties:
string Id, string Name, string? Folder
Dictionary<string,Component> Components
PrefabData? ParentPrefab // null if not a prefab instance
Component Access:
bool HasComponent(string componentType)
Component? GetComponent(string componentType)
void RemoveComponent(string componentType)
Component CloneComponent(Component source)
Adding Components:
Component AddComponent(string componentType)
StaticColliderWrapper AddStaticCollider()
RigidbodyWrapper AddRigidbody(float mass = 1.0f, bool isKinematic = false)
ModelWrapper AddModel()
LightWrapper AddLight()
ParticleSystemWrapper AddParticleSystem()
Typed Wrappers:
TransformWrapper? GetTransform()
ModelWrapper? GetModel()
StaticColliderWrapper? GetStaticCollider()
RigidbodyWrapper? GetRigidbody()
LightWrapper? GetLight()
ParticleSystemWrapper? GetParticleSystem()
void RemoveParticleSystem()
Hierarchy:
List<Entity> GetChildren()
Entity? FindChildByName(string name)
List<Entity> FindChildrenByName(string pattern)
Entity? GetParent()
List<Entity> GetDescendants()
bool HasChildren()
================================================================================
COMPONENT
================================================================================
Properties:
string Key // internal dictionary key
string Type, string Id
Dictionary<string,object> Properties
Get/Set:
T? Get<T>(string propertyName) // dot notation for nested: "Stats.Health"
void Set(string propertyName, object value)
Dictionary<string,object>? GetMultiValueProperty(string name) // Vector3, Color
void SetMultiValueProperty(string name, Dictionary<string,object> value)
References (use Get<T> with data types):
var entityRef = component.Get<EntityRefData>("TargetEntity"); // returns EntityRefData?
var assetRef = component.Get<AssetRefData>("MaterialRef"); // returns AssetRefData?
void SetEntityRef(string propertyName, Entity entity)
void SetAssetRef(string propertyName, AssetReference asset)
Collections:
void AddToList(string propertyName, object value)
void SetList(string propertyName, IEnumerable<object> values)
void SetDictionary(string propertyName, object key, object value)
================================================================================
TYPED WRAPPERS (Namespace: HS.Stride.Editor.Toolkit.Core.Wrappers)
================================================================================
TransformWrapper:
Component Component // underlying component
Vector3Data GetPosition() | void SetPosition(float x, y, z)
QuaternionData GetRotation() | void SetRotation(float x, y, z, w)
Vector3Data GetScale() | void SetScale(float x, y, z) | void SetUniformScale(float s)
Dictionary<string,object> GetChildren() // raw children dictionary
void AddChild(string entityId) | void RemoveChild(string entityId) | bool HasChild(string id)
ModelWrapper:
Component Component
bool Enabled
string Model // raw model reference string
Dictionary<string,object> Materials // raw materials dictionary
void SetModel(AssetReference modelAsset)
void SetModel(string guid, string path)
void SetMaterial(int slotIndex, AssetReference material)
StaticColliderWrapper / RigidbodyWrapper (inherit ColliderWrapperBase):
Component Component
Dictionary<string,object> ColliderShapes // raw shapes dictionary
float Friction, float Restitution, float RollingFriction
bool IsTrigger, bool CanSleep
void AddBoxShape(float sizeX=1, sizeY=1, sizeZ=1, bool is2D=false, float offsetX=0, offsetY=0, offsetZ=0)
void AddSphereShape(float radius=0.5, bool is2D=false, float offsetX=0, offsetY=0, offsetZ=0)
void AddCapsuleShape(float length=1, float radius=0.5, string orientation="UpY", float offsetX=0, offsetY=0, offsetZ=0)
void AddCylinderShape(float height=1, float radius=0.5, string orientation="UpY", float offsetX=0, offsetY=0, offsetZ=0)
void AddConeShape(float height=1, float radius=0.5, string orientation="UpY", float offsetX=0, offsetY=0, offsetZ=0)
void AddMeshShape(AssetReference modelAsset)
void AddConvexHullShape(AssetReference colliderShapeAsset) // requires .sdphy file
void AddPlaneShape(float normalX=0, normalY=1, normalZ=0, float offset=0)
void AddColliderShapeAsset(AssetReference colliderShapeAsset)
void AddColliderShapeAsset(string assetGuid, string assetPath)
RigidbodyWrapper additional:
float Mass, bool IsKinematic, float LinearDamping, float AngularDamping, bool OverrideGravity
Vector3Data GetGravity()
void SetGravity(float x, y, z)
LightWrapper:
Component Component
float Intensity
Dictionary<string,object> Type // light type configuration
ColorData GetColor()
void SetColor(float r, g, b, a=1.0)
================================================================================
PREFAB
================================================================================
Namespace: HS.Stride.Editor.Toolkit.Core.PrefabEditing
Static: Prefab Load(string filePath) | Prefab Create(string name, string? filePath = null)
Properties: string Id, string FilePath, List<Entity> AllEntities
Methods:
Entity? GetRootEntity()
Entity CreateEntity(string name, string? folder = null)
Entity CreateEntity(string name, string parent, ParentType parentType)
void RemoveEntity(Entity entity)
void Save() | void SaveAs(string filePath)
// Same Find methods as Scene
================================================================================
UIPAGE
================================================================================
Namespace: HS.Stride.Editor.Toolkit.Core.UIPageEditing
Static: UIPage Load(string filePath) | UIPage Create(string name, string? filePath = null)
Properties:
string Id, string FilePath
List<UIElement> AllElements, List<UIElement> RootElements
Dictionary<string,float> Resolution // raw resolution dictionary
Resolution:
(float X, Y, Z)? GetDesignResolution()
void SetDesignResolution(float x, y, z)
Generic Property Access:
object? Get(string propertyName)
void Set(string propertyName, object value)
Dictionary<string,object> GetAllProperties()
Element Creation:
UIElement CreateElement(string type, string name, UIElement? parent = null, bool autoAttach = true)
UIElement CreateTextBlock(string name, string text, UIElement? parent, float? fontSize = null)
UIElement CreateButton(string name, string text, UIElement? parent, float? width = null, float? height = null)
UIElement CreateImage(string name, AssetReference? spriteSheet, int? frame, UIElement? parent, float? w = null, float? h = null, bool stretchFill = false)
UIElement CreateImageFromTexture(string name, AssetReference texture, UIElement? parent, float? w = null, float? h = null)
UIElement CreateCanvas(string name, UIElement? parent, float? w = null, float? h = null)
UIElement CreateGrid(string name, UIElement? parent)
UIElement CreateStackPanel(string name, UIElement? parent)
UIElement CreateScrollViewer(string name, UIElement? content, UIElement? parent)
UIElement CreateEditText(string name, string placeholder, UIElement? parent, float? w = null, float? h = null)
UIElement CreateSlider(string name, float min, float max, float value, UIElement? parent, float? w = null)
UIElement CreateToggleButton(string name, string text, bool isChecked, UIElement? parent, float? w = null, float? h = null)
UIElement CreateScrollBar(string name, bool isVertical, UIElement? parent, float? w = null, float? h = null)
UIElement CreateBorder(string name, UIElement? parent, float? w = null, float? h = null)
UIElement CreateUniformGrid(string name, UIElement? parent)
UIElement CreateScrollingText(string name, string text, UIElement? parent, float? fontSize = null)
UIElement CreateModalElement(string name, UIElement? parent)
void RemoveElement(UIElement element)
Element Types: TextBlock, Button, ToggleButton, ImageElement, Canvas, Grid, StackPanel,
UniformGrid, ScrollViewer, ScrollBar, ScrollingText, EditText, Slider, Border,
ContentDecorator, ModalElement
Finding:
UIElement? FindElementById(string id)
UIElement? FindElementByName(string name)
IEnumerable<UIElement> FindElementsByName(string pattern)
IEnumerable<UIElement> FindElementsByType(string type)
IEnumerable<UIElement> FindElements(Func<UIElement,bool> predicate)
Persistence: void Save() | void SaveAs(string filePath)
================================================================================
UIELEMENT
================================================================================
Namespace: HS.Stride.Editor.Toolkit.Core.UIPageEditing
Properties:
string Id, string Name, string Type
UIElement? Parent
Dictionary<string,object> Properties
List<UIElement> Children
Methods:
object? Get(string key)
void Set(string key, object value)
bool HasProperty(string key)
void AddChild(UIElement child)
void RemoveChild(UIElement child)
UIElement? FindChildByName(string name)
List<UIElement> GetDescendants()
================================================================================
UIELEMENT EXTENSIONS (All Methods)
================================================================================
Namespace: HS.Stride.Editor.Toolkit.Core.UIPageEditing
--- LAYOUT ---
SetSize(float w, h) | SetWidth(float) | SetHeight(float)
GetSize() -> (float Width, Height) | GetWidth() -> float | GetHeight() -> float
SetMargin(float l, t, r, b) | GetMargin() -> (float Left, Top, Right, Bottom)
SetPadding(float l, t, r, b) | GetPadding() -> (float Left, Top, Right, Bottom)
SetPosition(float x, y) | GetPosition() -> (float X, Y)
SetAlignment(string horizontal, string vertical) // "Left","Center","Right","Stretch"
GetHorizontalAlignment() -> string | GetVerticalAlignment() -> string
GetAlignment() -> (string Horizontal, string Vertical)
SetStretchFill() | SetImageStretchFill()
GetParentDimensions() -> (float Width, Height)
SetVisibility(bool visible) | IsVisible() -> bool
SetCanBeHitByUser(bool) | GetCanBeHitByUser() -> bool
SetClipToBounds(bool) | GetClipToBounds() -> bool
SetDrawLayerNumber(int) | GetDrawLayerNumber() -> int
--- APPEARANCE ---
SetBackgroundColor(float r, g, b, a) | GetBackgroundColor() -> (float R, G, B, A)?
SetTextColor(float r, g, b, a) | GetTextColor() -> (float R, G, B, A)?
SetColor(float r, g, b, a) | GetColor() -> (float R, G, B, A)?
SetOpacity(float) | GetOpacity() -> float
--- TEXT ---
SetText(string text) | GetText() -> string?
SetFont(AssetReference font) | GetFont() -> AssetReference?
SetFontSize(float size) | GetFontSize() -> float?
SetWrapText(bool) | GetWrapText() -> bool
SetTextAlignment(string alignment) // "Left","Center","Right"
SetOutlineColor(float r, g, b, a)
SetOutlineThickness(int)
--- SPRITES/TEXTURES ---
SetSprite(AssetReference sheet, int frame)
SetTexture(AssetReference texture)
SetPressedImage(AssetReference sheet, int frame)
SetNotPressedImage(AssetReference sheet, int frame)
SetMouseOverImage(AssetReference sheet, int frame)
SetPressedTexture(AssetReference texture)
SetNotPressedTexture(AssetReference texture)
SetMouseOverTexture(AssetReference texture)
SetButtonImages(AssetReference sheet, int pressedFrame, int notPressedFrame, int? mouseOverFrame = null)
SetButtonTextures(AssetReference pressedTex, AssetReference notPressedTex, AssetReference? mouseOverTex = null)
--- SPRITE DETECTION ---
bool IsSpriteFromSheet(string propertyName)
bool IsSpriteFromTexture(string propertyName)
(AssetReference? Sheet, int Frame) GetSpriteSheet(string propertyName)
AssetReference? GetTextureSource(string propertyName)
bool IsButtonUsingSpriteSheet()
bool IsButtonUsingTexture()
bool IsImageUsingSpriteSheet()
bool IsImageUsingTexture()
--- BEHAVIOR ---
SetIsEnabled(bool) | GetIsEnabled() -> bool
SetClickMode(string mode) | GetClickMode() -> string // "Press" or "Release"
SetOrientation(string) | GetOrientation() -> string // "Horizontal" or "Vertical"
--- ZINDEX ---
SetZIndex(int) | GetZIndex() -> int // higher = on top
--- CONTENT (Button, ToggleButton, ScrollViewer, ContentDecorator) ---
SetContent(UIElement content) | GetContent() -> UIElement?
--- BORDER ---
SetBorderColor(float r, g, b, a)
SetBorderThickness(float l, t, r, b)
SetBorderThicknessUniform(float thickness)
--- SLIDER ---
SetMinimum(float) | GetSliderMinimum() -> float
SetMaximum(float) | GetSliderMaximum() -> float
SetValue(float) | GetSliderValue() -> float
SetStep(float) | GetSliderStep() -> float
SetRange(float min, float max)
GetSliderRange() -> (float Min, float Max)
SetTickFrequency(float) | GetTickFrequency() -> float
SetSnapToTicks(bool) | GetSnapToTicks() -> bool
SetAreTicksDisplayed(bool) | GetAreTicksDisplayed() -> bool
SetTrackBackgroundImage(AssetReference sheet, int frame)
SetTrackForegroundImage(AssetReference sheet, int frame)
SetThumbImage(AssetReference sheet, int frame)
SetMouseOverThumbImage(AssetReference sheet, int frame)
SetTrackBackgroundTexture(AssetReference texture)
SetTrackForegroundTexture(AssetReference texture)
SetThumbTexture(AssetReference texture)
SetMouseOverThumbTexture(AssetReference texture)
--- EDITTEXT ---
SetActiveImage(AssetReference sheet, int frame)
SetInactiveImage(AssetReference sheet, int frame)
SetActiveTexture(AssetReference texture)
SetInactiveTexture(AssetReference texture)
SetMaxLength(int) | GetMaxLength() -> int
SetIsReadOnly(bool) | GetIsReadOnly() -> bool
SetMinLines(int) | GetMinLines() -> int
SetMaxLines(int) | GetMaxLines() -> int
SetCaretColor(float r, g, b, a)
SetSelectionColor(float r, g, b, a)
SetCaretFrequency(float)
--- TOGGLEBUTTON ---
SetIsChecked(bool) | IsChecked() -> bool
SetIsThreeState(bool) | GetIsThreeState() -> bool
SetCheckedImage(AssetReference sheet, int frame)
SetUncheckedImage(AssetReference sheet, int frame)
SetIndeterminateImage(AssetReference sheet, int frame)
SetCheckedTexture(AssetReference texture)
SetUncheckedTexture(AssetReference texture)
SetIndeterminateTexture(AssetReference texture)
SetToggleButtonImages(AssetReference sheet, int checkedFrame, int uncheckedFrame, int? indeterminateFrame = null)
SetToggleButtonTextures(AssetReference checkedTex, AssetReference uncheckedTex, AssetReference? indeterminateTex = null)
--- SCROLLVIEWER ---
SetScrollContent(UIElement content)
SetScrollMode(string mode) // "None", "Horizontal", "Vertical", "Both"
SetScrollBarColor(float r, g, b, a)
SetScrollBarThickness(float)
SetDeceleration(float)
SetTouchScrollingEnabled(bool)
SetSnapToAnchors(bool)
--- SCROLLINGTEXT ---
SetScrollingSpeed(float)
SetDesiredCharacterNumber(int)
SetRepeatText(bool)
--- CONTENTDECORATOR ---
SetBackgroundImage(AssetReference sheet, int frame)
SetBackgroundTexture(AssetReference texture)
--- MODALELEMENT ---
SetOverlayColor(float r, g, b, a)
SetIsModal(bool)
--- IMAGEELEMENT ---
SetStretchType(string type) // "None", "Fill", "Uniform", "UniformToFill"
SetStretchDirection(string dir) // "UpOnly", "DownOnly", "Both"
================================================================================
PARTICLE SYSTEM
================================================================================
entity.AddParticleSystem() -> ParticleSystemWrapper
ParticleSystemWrapper:
Component Component
string Control // "Play", "Pause", "Stop"
float ResetSeconds, float Speed
Dictionary<string,object> Color // raw color dictionary
void SetColor(float r, g, b, a=1.0)
void AddEmitter(VFXEmitter emitter)
List<VFXEmitter> GetEmitters()
bool RemoveEmitter(string emitterKey)
// Emitter Creation (extension methods)
VFXEmitter CreateBillboardEmitter(string? name, (float min, max)? lifetime)
VFXEmitter CreateOrientedQuadEmitter(string? name, (float min, max)? lifetime, bool scaleLength=true, float lengthFactor=1.0)
VFXEmitter CreateRibbonEmitter(string? name, (float min, max)? lifetime, int segments=15, VFXSmoothingPolicy policy=Best, int maxParticles=50)
VFXEmitter:
string? EmitterName, (float min, max) ParticleLifetime
int? MaxParticlesOverride, int? DrawPriority
string? SimulationSpace // "World" or "Local"
string? SortingPolicy // "ByOrder", "ByDepth"
T? Get<T>(string key) // supports dot notation
void Set(string key, object? value)
// Shape
void SetShapeBuilder(VFXShapeType shapeType, Dictionary<string,object>? shapeData = null)
// Material
void SetMaterial(Dictionary<string,object> materialData) // raw material
SetTextureMaterial(AssetReference tex, float hdrMultiplier=1.0, float alphaAdditive=0.0)
SetTextureMaterial(AssetReference tex, float hdrR, hdrG, hdrB, float alphaAdditive=0.0)
SetFlipbookAnimation(int xDivisions, yDivisions, startFrame, animationSpeed)
// Spawning
void AddSpawner(string spawnerType, Dictionary<string,object> spawnerData) // raw
SetBurstSpawner(int count, bool oneShot=true, (float min, max)? delay=null)
SetPerSecondSpawner(float perSec, bool looping=true, (float min, max)? delay=null, (float min, max)? duration=null)
SetPerFrameSpawner(float perFrame, float framerate=60.0, bool looping=true)
// Initializers
void AddInitializer(string initializerType, Dictionary<string,object> initializerData) // raw
AddInitialSize((float min, max) sizeRange, float scaleUniform=1.0, int seedOffset=0)
AddInitialPosition((float x,y,z) min, (float x,y,z) max, int seedOffset=0)
AddInitialVelocity((float x,y,z) min, (float x,y,z) max, int seedOffset=0)
AddInitialRotation((float min, max) angleRange, int seedOffset=0)
AddInitialColor((float r,g,b,a) colorMin, (float r,g,b,a) colorMax, int seedOffset=0)
AddSpawnOrder() // required for ribbons
// Updaters
void AddUpdater(string updaterType, Dictionary<string,object> updaterData) // raw
AddColorFade(params (float time, float r, g, b, a)[] keyframes) // time 0.0-1.0
AddSizeOverTime(params (float time, float size)[] keyframes)
AddForceField(VFXFieldShape shape=Sphere, (float x,y,z)? scale=null, float forceDirected=0, forceVortex=0, forceRepulsive=0, energyConservation=0.2)
Enums:
VFXShapeType: Billboard, OrientedQuad, Ribbon
VFXFieldShape: Sphere, Cylinder, Cube, Torus, Box, HollowSphere
VFXSmoothingPolicy: None, Fast, Best
================================================================================
DIRECT ASSET EDITING
================================================================================
All implement IStrideAsset: string Id, string FilePath, void Save(), void SaveAs(string path)
All have: object? Get(string prop), void Set(string prop, object val), Dictionary<string,object> GetAllProperties()
MaterialAsset:
string? GetDiffuseTexture() | void SetDiffuseTexture(string textureReference)
(float X, Y)? GetUVScale() | void SetUVScale(float x, y)
TextureAsset:
bool IsStreamable, bool? PremultiplyAlpha
string? GetSource() | void SetSource(string sourcePath)
AnimationAsset:
string? RepeatMode // "LoopInfinite", "PlayOnce"
bool RootMotion
string? GetSource() | void SetSource(string sourcePath)
string? GetSkeletonReference() | void SetSkeletonReference(string skelRef)
string? GetPreviewModel() | void SetPreviewModel(string modelRef)
ColliderShapeAsset:
AssetReference GetReference() // after saving
SoundAsset, SkeletonAsset, SpriteSheetAsset, EffectAsset: Use generic Get/Set
================================================================================
DATA TYPES
================================================================================
Namespace: HS.Stride.Editor.Toolkit.Core.DataTypes
Vector3Data(float X, Y, Z)
Static: Zero, One
ToMultiValueProperty() -> Dictionary<string,object>
static FromMultiValueProperty(Dictionary<string,object>?) -> Vector3Data
QuaternionData(float X, Y, Z, W)
Static: Identity
ToMultiValueProperty(), static FromMultiValueProperty()
ColorData(float R, G, B, A)
Static: White, Black
ToMultiValueProperty(), static FromMultiValueProperty()
PrefabData:
string PrefabSourcePath // source prefab asset path
string PrefabEntityId // root entity ID in prefab
string InstanceId // unique instance ID
EntityRefData:
static Parse(string refString) -> EntityRefData?
// Used with component.Get<EntityRefData>("PropertyName")
AssetRefData:
static Parse(string refString) -> AssetRefData?
// Used with component.Get<AssetRefData>("PropertyName")
AssetReference:
string Id, Name, Path, FilePath
AssetType Type
string Reference // "guid:path" format
AssetType: Unknown, Prefab, Model, Material, Texture, Scene, Sound, Animation,
Skeleton, SpriteSheet, Sprite, Effect, UIPage, UILibrary, SpriteFont, Skybox,
Video, RenderTexture, GameSettings, GraphicsCompositor, Archetype,
ColliderShape, ConvexHull, RawAsset, Script
ParentType: Folder (editor organization only), Entity (transform hierarchy)
ProjectMode: Strict, Loose
================================================================================
ERROR HANDLING
================================================================================
Exceptions:
ArgumentNullException - null/whitespace parameters
FileNotFoundException - loading non-existent files
ArgumentException - invalid arguments (e.g., not a Stride project)
InvalidOperationException - Strict mode property validation failure
Null-safe: FindEntity*, GetComponent, FindAsset, Get<T> return null/default if not found
Pattern: if (entity.HasComponent("X")) { var c = entity.GetComponent("X"); ... }
================================================================================
QUICK REFERENCE EXAMPLES
================================================================================
// Basic workflow
var project = new StrideProject(@"C:\MyGame");
var scene = project.LoadScene("Level1");
var player = scene.FindEntityByName("Player");
player.GetTransform().SetPosition(10, 0, 5);
scene.Save();
// Add component with properties
var health = player.AddComponent("HealthComponent");
health.Set("MaxHealth", 100.0f);
// Get entity/asset references from components
var targetRef = component.Get<EntityRefData>("TargetEntity");
var materialRef = component.Get<AssetRefData>("MaterialRef");
// Instantiate prefab
var prefab = project.FindAsset("Enemy", AssetType.Prefab);
scene.InstantiatePrefab(prefab, new Vector3Data(10, 0, 5), "Enemies");
// Add collider with shapes
var collider = entity.AddStaticCollider();
collider.AddBoxShape(1.0f, 1.0f, 1.0f);
collider.Friction = 0.8f;
collider.RollingFriction = 0.1f;
// Create UI page
var page = project.CreateUIPage("Menu", "UI");
page.SetDesignResolution(1920, 1080, 1000);
var root = page.RootElements.First();
var btn = page.CreateButton("start", "Start Game", root, 200f, 50f);
btn.SetPosition(860f, 500f);
btn.SetBackgroundColor(0.2f, 0.4f, 0.8f, 1.0f);
page.Save();
// UI with type-specific methods
var slider = page.CreateSlider("volume", 0f, 100f, 50f, root, 200f);
slider.SetTrackBackgroundColor(0.3f, 0.3f, 0.3f, 1.0f);
slider.SetThumbImage(spriteSheet, 5);
slider.SetSnapToTicks(true);
var toggle = page.CreateToggleButton("mute", "Mute", false, root, 100f, 40f);
toggle.SetCheckedImage(spriteSheet, 10);
toggle.SetUncheckedImage(spriteSheet, 11);
// Create particle effect
var vfx = entity.AddParticleSystem();
vfx.Control = "Play";
var smoke = vfx.CreateBillboardEmitter("smoke", (3.0f, 5.0f));
var tex = project.FindAsset("SmokeTexture", AssetType.Texture);
smoke.SetTextureMaterial(tex, hdrMultiplier: 1.0f, alphaAdditive: 0.5f);
smoke.SetPerSecondSpawner(10.0f);
smoke.AddInitialSize((0.5f, 1.5f));
smoke.AddInitialVelocity((0, 0.5f, 0), (0, 1.0f, 0));
vfx.AddEmitter(smoke);