Repository navigation
en editor sprite editor
中文 | English | Docs | Repository
In an existing project, right-click an image in the Asset Browser and choose Open Sprite Editor. You can also open the window with Window > Sprite Editor, then enter Assets/Textures/Image.png and click Open. The image must live in the current project's Assets directory and must already be imported.
The list on the left selects the logical sprite; the right side shows the source image and the slice borders. Select / Move drags the selected rectangle, and dragging the bottom-right handle resizes it. Create draws a new rectangle on the source image. Coordinates and sizes are in source-image pixels with the origin at the top-left; the pivot uses normalized coordinates measured from the bottom-left. The property area covers name, rectangle, pivot, and Pixels Per Unit. Ordinary assets default to a PPU of 100.
Grid Slice cuts the image by Cell Width/Height, Offset, and Padding, with an option to keep incomplete edge cells. Auto Slice produces one rectangle per four-connected opaque region, with configurable alpha threshold and a minimum opaque pixel count. When slices are regenerated, rectangles that are exactly identical keep their original UUID, name, and properties. Converting a single sprite into multiple slices lets the first new slice inherit the original single-sprite reference, and deleting a slice removes its logical reference target.
While dragging, only a preview is shown; releasing records one global Undo. A click at zero distance does not modify data. Escape cancels a drag that has not been committed. Undo / Redo shares its history with the Inspector, and closing and reopening the panel does not create a second draft.
Click Apply & Reimport to store the draft and reimport. Editing pauses during the import, and the new asset revision is used afterwards. Apply itself can be undone or redone, and the operation performs the import again. Revert discards the current draft and restores the import settings on disk. When the source image changes, resolve the draft first and then click Reload Source; conflicting external metadata blocks Apply so that other modifications are not overwritten.
The border property area uses four pixel widths: Left, Bottom, Right, and Top, and the preview draws green guide lines. SpriteRenderer's Sliced mode uses Size for the world size, keeps the corner PPU sizes, and stretches the middle region; a target that is too small compresses the borders proportionally. Tiled mode repeats the middle region and the border strips at the original PPU size, crops the UVs of a trailing partial cell, and produces at most 65,536 quads per sprite. Simple keeps using the source image dimensions.
C++ uses GetDrawMode / SetDrawMode and ESpriteDrawMode; C# and Lua use GetDrawModeValue / SetDrawModeValue (0 Simple, 1 Sliced, 2 Tiled) together with GetSize / SetSize. Invalid modes or sizes are rejected. Resources, serialization, GPU behavior, and the standalone Player have been verified on Windows/DX12; the real mouse operation of every control and the other platforms are still verified separately.
Trim, tight mesh, physics outlines, and Atlas editing are still being implemented, and the full Phase 2 acceptance is not complete. The status of automated tests, real desktop mouse acceptance, and per-platform GPU acceptance is recorded in Docs/Plans/2D/Progress.md.
Nullus Engine
中文
- 认识 Nullus
- 安装与快速入门
- 使用编辑器
- 场景与对象
- Prefab 工作流
- 资产与内容管线
- 渲染、材质与光照
- 大场景与资源管理
- 游戏逻辑与脚本
- 用户界面
- 动画与角色
- 物理与交互
- 音频、特效与媒体
- AI 与联网
- 平台、构建与发布
- 扩展与引擎架构
- 调试、性能与质量
- 参考手册
- 示例与发展路线
English
- Getting to Know Nullus
- Install and Quick Start
- Using the Editor
- Scenes and Objects
- Prefab Workflow
- Assets and Content Pipeline
- Rendering, Materials, and Lighting
- Large Scenes and Resource Management
- Gameplay and Scripting
- User Interface
- Animation and Characters
- Physics and Interaction
- Audio, Visual Effects, and Media
- AI and Networking
- Platforms, Builds, and Releases
- Extending the Engine
- Debugging, Performance, and Quality
- Reference
- Examples and Roadmap