Krotox Engine › Docs › Krotox Manual › 2D Content
Every 2D component you can add in the inspector, with its fields and defaults: transforms and sorting, sprites and animation, shapes, lines, trails, text, particles, masks, sprite effects, 2D lights, parallax, cameras and audio.
Components are added from Add Component in the Properties panel (the 2D tab lists the 2D ones). This page lists what each one does and what its fields mean. Physics components have their own page: 2D physics. Scripting access is covered in Sprites, animation, cameras & effects API.
Every entity has one.
| Field | Default | Meaning |
|---|---|---|
Translation | 0, 0, 0 | Position, relative to the parent. In 2D, X is right and Y is up. |
Rotation | 0, 0, 0 | Euler angles in radians. 2D rotation is around Z. The inspector shows degrees. |
Scale | 1, 1, 1 | Size multiplier. Also scales colliders. |
For a child entity, the inspector also shows its read-only world position, rotation and scale.
Every 2D renderer (sprites, animated sprites, shapes, circles, lines, trails, text, masks) has two sorting fields:
Use layers for broad groups and Order in Layer for fine control inside a group.
Draws a texture (or one cell of a sprite sheet) on a quad.
| Field | Default | Meaning |
|---|---|---|
Color | white | Tint multiplied with the texture. Alpha below 1 makes it see-through. |
Texture | none | The image. Drag one from the Content Browser. With none, it draws a solid colour quad. |
Tiling Factor | 1, 1 | Repeats the texture across the quad. |
Use Sub Texture | off | Draw one cell of a sprite sheet instead of the whole image. |
Sub Texture Coords | 0, 0 | Which cell (column, row). |
Cell Size | 16, 16 | Size of one cell in pixels. |
Sprite Size | 1, 1 | How many cells the sprite spans. |
Gap Size | 0, 0 | Pixel spacing between cells on the sheet. |
Flip X / Flip Y | off | Mirror the image. Handy for turning a character around. |
Pivot | 0.5, 0.5 | The point the sprite rotates and scales around. |
Draw Mode | Simple | Simple stretches the image. Sliced keeps the corners at their size and stretches the middle (nine-slice), using Slice Border. |
Pixels Per Unit | 100 | How many texture pixels make one world unit. |
Normal Map | none | Optional normal map, so 2D lights shade the sprite. |
Mask Interaction | None | Visible Inside Mask or Visible Outside Mask to be clipped by a Sprite Mask. |
Plays frames from a sprite sheet (or a list of separate images).
| Field | Default | Meaning |
|---|---|---|
Sprite Sheet | none | The sheet the frames come from. |
Cell Size / Sprite Size / Gap Size | 16, 16 / 1, 1 / 0, 0 | Same as the Sprite Renderer's sub-texture fields. |
Frames | empty | The ordered list of cells to play. |
Use Individual Textures | off | Play a list of separate images instead of sheet cells. |
Frame Duration | 0.1 s | How long each frame shows. 0.05 is 20 frames per second. |
Is Playing / Loop | on / on | Playback state; loop back to the first frame at the end. |
Flip X / Flip Y, Pivot | off, 0.5, 0.5 | As on the Sprite Renderer. |
Use State Machine | off | Use named states (such as *Idle*, *Run*, *Jump*), each with its own frames. |
States, Default State | — | The states, and which one starts. |
With the state machine on, scripts switch animations with SetAnimationState("Run"). For timelines and parameter-driven transitions, use the Animator with the State Machine panel instead.
A circle or ring drawn with smooth, anti-aliased edges.
| Field | Default | Meaning |
|---|---|---|
Color | white | Tint. |
Radius | 0.5 | Radius in world units. |
Thickness | 1 | 1 is a filled disc; smaller values make a ring. |
Fade | 0.005 | Edge softness. Raise it for glows and soft vignettes. |
Texture | none | Optional texture inside the circle (sub-textures supported). |
Regular shapes without a texture: Triangle, Diamond, Pentagon, Hexagon, Octagon and Star.
| Field | Default | Meaning |
|---|---|---|
Type | Hexagon | Which shape. |
Sides | 6 | Side count for polygons. |
Inner Radius | 0.45 | Inner radius (the depth of a star's points). |
Thickness | 1 | 1 is filled; smaller values give an outline. |
Fade | 0 | Edge softness. |
A polyline of one width and colour, for ropes, bowstrings, lasers and trajectory previews.
| Field | Default | Meaning |
|---|---|---|
Points | (-0.5, 0), (0.5, 0) | The points, edited as a list with *Add Point* and remove buttons. |
Width | 0.05 | Width in world units, whatever the entity's scale. Corners are mitred, and bevelled when sharper than about 29°. |
Color, Loop | white, off | Colour; join the last point back to the first. |
Use World Space | off | Off: points move with the entity. On: points are world positions. |
Leaves a fading ribbon behind a moving entity: sword swings, dashes, projectiles.
| Field | Default | Meaning |
|---|---|---|
Time | 1 s | How long a point stays in the trail. |
Min Vertex Distance | 0.1 | How far the entity must move before a new point is added. |
Start Width / End Width | 0.2 / 0 | Width at the head and the tail. |
Start Color / End Color | — | Colour along the trail, usually fading to transparent. |
Emitting | on | Turn off to stop adding points (the trail fades out). |
Texture | none | Optional texture along the ribbon. |
Text that lives in the world, rendered with multi-channel signed distance fields so it stays sharp at any zoom. For menus and HUDs, use UI Text on a canvas instead (see Game UI).
| Field | Default | Meaning |
|---|---|---|
Text | — | The string (UTF-8). |
Font Family | Montserrat | Which font. |
Color, Font Size | white, 1 | Colour and size multiplier. |
Kerning, Line Spacing | 0, 0 | Extra space between characters and between lines. |
Bold, Italic | off | Uses real bold and italic font files when the font has them. |
Drop Shadow (colour, distance, softness) | off | A shadow pass under the text. |
Outline (colour, width) | 0 | A stroke around each glyph. |
Alignment, Vertical Alignment | Center, Center | Horizontal and vertical alignment. |
Word Wrap, Wrap Width | off, 10 | Break lines at word boundaries before this width (world units). |
Emits many small sprites for sparks, smoke, dust, rain and explosions.
| Field | Default | Meaning |
|---|---|---|
Texture | none | Particle image; with none, plain coloured quads. |
Is Emitting, Emission Rate | on, 10 | Continuous emission, in particles per second. |
Bursts | none | One-off bursts of N particles at set times in the cycle. |
Duration, Looping, Prewarm, Start Delay | 5 s, on, off, 0 | The emitter's cycle. Prewarm starts it as if it had already been running. |
Play On Awake | on | Start when the scene starts. |
Start Speed | 5 | Initial speed of each particle. |
Gravity Modifier | 0 | How strongly gravity pulls particles. |
Simulation Space | Local | Local: particles move with the emitter. World: they stay where they were emitted. |
Simulation Speed | 1 | Playback speed. |
Shape, Shape Radius, Shape Angle | Point, 1, 25° | Where particles start: Point, Circle, Cone, Box, Sphere, Hemisphere. |
Blending | Alpha | Alpha for smoke and dust, Additive for fire, sparks and glows. |
Noise (strength, frequency, scroll speed) | off | Turbulence for drifting smoke and embers. |
Collision (bounciness, friction, kill on collision) | off | Let particles bounce off the world. |
Colour and size over lifetime are edited as curves in the inspector.
Shows or hides parts of other sprites, using its texture's shape. Sprites opt in through their Mask Interaction field.
| Field | Default | Meaning |
|---|---|---|
Texture (+ sub-texture fields) | none | The mask shape. |
Alpha Cutoff | 0.2 | Texture pixels more opaque than this count as inside the mask. |
Invert | off | Swap inside and outside. |
Show Mask Graphic | off | Also draw the mask's own texture. |
Custom Range | off | Only affect sprites between a front and a back sorting position, instead of every sprite. |
Shader effects for Sprite Renderers and Animated Sprites on the same entity.
| Field | Default | Meaning |
|---|---|---|
Enabled | on | Turn every effect off at once. |
Flash Color, Flash Amount | white, 0 | Tints the sprite toward a colour. Scripts call HitFlash(seconds) for a damage flash. |
Outline, Outline Color, Outline Width | off, white, 2 px | An outline around the sprite's opaque pixels (width in screen pixels). |
Dissolve Amount | 0 | 0 is whole, 1 is gone. Animate it to burn a sprite away. |
Dissolve Edge Color, Edge Width, Noise Scale | orange, 0.08, 8 | The glowing edge and the grain of the dissolve. |
Lights 2D scenes. Turn the scene's ambient light down (SceneManager.AmbientLight2D from scripts) and add lights to bring areas up.
| Field | Default | Meaning |
|---|---|---|
Type | Point | Point (radial), Spot (a cone) or Global (lights everything). |
Color, Intensity | white, 1 | Colour and brightness. |
Inner Radius, Outer Radius | 0, 5 | Full brightness inside the inner radius, fading to zero at the outer. |
Falloff | 1 | Shape of the fade. |
Inner Angle, Outer Angle | 25°, 45° | A spot light's cone. |
Cast Shadows, Shadow Strength, Shadow Softness | off, 0.8, 0 | Hard shadows from shadow-caster geometry. Softness is the light's size in world units; 0 is hard. |
Turn on Scene ▸ Show Light 2D Ranges to see each light's reach in the Viewport. Sprites with a normal map are shaded per pixel.
Moves a background layer slower or faster than the camera for depth.
| Field | Default | Meaning |
|---|---|---|
Factor | 0.5, 0 | 0 is fixed to the camera (very far away), 1 moves with the world. Per axis. |
Repeat | 0, 0 | Wrap the layer every this many units, for endless backgrounds. 0 disables wrapping. |
Every scene needs one primary camera; the game is drawn through it.
| Field | Default | Meaning |
|---|---|---|
Projection | Orthographic | Orthographic is what 2D games use. |
Orthographic Size | 10 | How much of the world is visible vertically. Smaller is more zoomed in. |
Near / Far Clip | — | Depth range. |
Fixed Aspect Ratio | off | Keep the aspect ratio when the window resizes. |
Persistent | off | Keep this camera across scene loads. |
Blend Time, Blend Target | 1 s, none | Smoothly blend toward another camera. |
Makes the camera follow a target smoothly. Add it to the camera entity.
| Field | Default | Meaning |
|---|---|---|
Target | none | The entity to follow (usually the player). |
Offset | 0, 0 | Where the target sits relative to the centre of the view. |
Damping | 0.15, 0.15 | Smoothing per axis. 0 snaps; larger values lag more. |
Dead Zone | 0, 0 | An area in the middle where the target can move without the camera moving. |
Look Ahead Time, Look Ahead Max | 0, 2 | Lead the camera in the direction the target is moving. |
Use Bounds, Bounds Min, Bounds Max | off, -10, 10 | Keep the view inside the level. |
Pixel Snap, Pixels Per Unit | off, 16 | Snap the camera to whole pixels, for pixel art. |
A region that changes how the follow camera behaves while its target is inside: lock the view to a room, zoom out for a boss arena, slow the follow in a cave.
| Field | Default | Meaning |
|---|---|---|
Enabled, Priority | on, 0 | Overlapping zones resolve by priority. |
Offset, Size | 0, 0, 20 × 12 | The zone's rectangle. |
Blend Time | 0.5 s | How long the camera takes to adjust when the target enters or leaves. |
Confine View | on | Keep the view inside the zone. |
Override Damping, Override Dead Zone, Override Zoom (+ Orthographic Size) | off | Replace the follow camera's settings while inside. |
Trauma-based screen shake: the more trauma, the stronger the shake, and trauma decays over time.
| Field | Default | Meaning |
|---|---|---|
Max Offset | 0.5 | Largest positional shake, in world units. |
Max Angle | 3° | Largest rotational shake. |
Frequency | 25 | How fast it shakes. |
Trauma Decay | 1.5 | How quickly trauma fades, per second. |
Plays a sound on an entity.
| Field | Default | Meaning |
|---|---|---|
Audio Path | — | The file, relative to Assets: .wav, .mp3, .ogg or .flac. |
Group | SFX | Mixer group: Master, Music, SFX, UI, Dialogue or Ambience. |
Volume, Pitch, Pan | 1, 1, 0 | Loudness, speed, stereo position. |
Volume Variation, Pitch Variation | 0, 0 | Random variation per play, so repeated sounds do not sound identical. |
Loop, Play On Start | off, on | |
Stream | off | Stream from disk instead of decoding into memory. Use it for music. |
Fade In / Fade Out Duration | 0, 0 | Fades when playing and stopping. |
Priority | 128 | Which sounds survive when too many play at once. |
Spatial, Min Distance, Max Distance | off, 1, 100 | Fade with distance from the Audio Listener. |
Put an Audio Listener on the camera (or the player) for spatial sounds. Group volumes are mixed in Window ▸ Audio Mixer.
Runs one of your C# classes on the entity. Set the class name with its namespace (for example Sandbox.PlayerController), or drag a .cs file onto the entity. The script's public fields appear underneath. See Writing scripts & the lifecycle.