Built-in Components
Built-in components are first-class Lua classes and can also be added through
the editor or actor:AddComponent(type_name).
Transform
Properties
actorkeyenabledxyrotation
Transform stores local transform values. World transform is derived by the
engine and is not directly exposed as writable Lua properties.
SpriteRenderer
Properties
actorkeyenabledspritergbapivot_xpivot_yscale_xscale_ysprite_rowsprite_columnsorting_orderauto_sorting_order
Methods
| Method | Description |
|---|---|
SetSpriteCell(row, column) |
Convenience setter for sprite_row / sprite_column |
Notes
spriteis the image resource name, for exampleimages/Run.png- spritesheet slicing comes from project metadata in
.engine/project/spritesheets.json - custom gameplay components can store sub-sprite references as encoded strings,
but
SpriteRendereritself still uses separate row / column fields
Rigidbody
Properties
actorkeyenabledxybody_typeprecisegravity_scaledensityangular_frictionrotationhas_colliderhas_triggercollider_typewidthheightradiustrigger_typetrigger_widthtrigger_heighttrigger_radiusfrictionbounciness
Methods
| Method | Description |
|---|---|
OnStart() |
Internal lifecycle hook |
OnDestroy() |
Internal lifecycle hook |
AddForce(vec) |
Adds force |
SetVelocity(vec) |
Sets linear velocity |
SetPosition(vec) |
Sets position |
SetRotation(degrees) |
Sets rotation |
SetAngularVelocity(value) |
Sets angular velocity |
SetGravityScale(value) |
Sets gravity scale |
SetUpDirection(vec) |
Sets orientation from up vector |
SetRightDirection(vec) |
Sets orientation from right vector |
GetPosition() |
Returns Vector2 |
GetRotation() |
Returns rotation |
GetVelocity() |
Returns Vector2 |
GetAngularVelocity() |
Returns angular velocity |
GetGravityScale() |
Returns gravity scale |
GetUpDirection() |
Returns Vector2 |
GetRightDirection() |
Returns Vector2 |
Notes
PocketEngine derives an effective_body_type internally for dynamic actor
hierarchies. The authored Lua-visible body_type remains the requested value.
ParticleSystem
Properties
actorkeyenabledxyframes_between_burstsburst_quantityduration_framesstart_scale_minstart_scale_maxstart_speed_minstart_speed_maxrotation_minrotation_maxrotation_speed_minrotation_speed_maxstart_color_rstart_color_gstart_color_bstart_color_aend_color_rend_color_gend_color_bend_color_aemit_radius_minemit_radius_maxemit_angle_minemit_angle_maxgravity_scale_xgravity_scale_ydrag_factorangular_drag_factorend_scaleimagesorting_order
Methods
| Method | Description |
|---|---|
OnStart() |
Internal lifecycle hook |
OnUpdate() |
Internal lifecycle hook |
OnDestroy() |
Internal lifecycle hook |
Stop() |
Stops emission |
Play() |
Starts emission |
Burst() |
Emits one burst immediately |