Jump to content

How to use Kunai

From HedgeDocs
Revision as of 13:03, 27 February 2025 by NextinHKRY (talk | contribs)

This guide will explain most features of Kunai, and how you can use it to edit Csd Project files and make custom UIs as well.

Explanation and terminology

Csd files are complex, but they are made of 5 primary types, which are: Scene Nodes (they'll be referred to as Nodes from now on), Scenes, Casts, Animations and Crops. Nodes are like sub-folders for the file, they contain collections of Scenes and they can contain sub-nodes. Scenes on the other hand contain Casts and Animations.

Casts

Casts are the actual UI elements that the games displays to the player, and they can be of 3 types:

  • Null (or No Draw)
  • Sprite
  • Font

Null Casts are casts that have no visual information attached to them, and because of that they are fully transparent, these are used primarily as ways to move, scale or tint collections of other casts.

Sprite Casts are casts that can display a Crop, which is Sega's term for a cropped sprite, these can contain multiple crops at once that can be switched through by animations or from code, which are called Patterns. Most files can only contain 32 patterns per cast, but games like Sonic Colors Ultimate can hold up to 256.

Font Casts are casts that can display multiple crops at once in the form of a makeshift font, they can hold onto text, and the individual characters can be spaced out (Kunai cannot edit these at the moment, but there will be a window to edit them soon).

All Casts share some key properties, they can be hidden, toggled on or off, they can be tinted from the 4 corners of a cast as well as tinted in its entirety, they can be moved, scaled, rotated, they can be animated, and they can inherit values from parent casts through the use of the inheritance flags.

Animations

Animations are used by the game to manipulate the scene's Casts, each animation in a scene can edit any casts inside of it, and they can manipulate some of the casts' values, such as:

  • Visibility
  • Horizontal Position
  • Vertical Position
  • Rotation
  • Horizontal Scale
  • Vertical Scale
  • Color
  • Vertex Colors (casts can be tinted on all 4 corners in addition to tinting it all)
  • Pattern

How to use the interface

Kunai is made up of 4 main windows with some extra windows that can be used by enabling them through the View menu ( View > Windows ).

Hierarchy

The Hierarchy displays the contents of the currently loaded file, Nodes will have a folder icon, Scenes will have a film icon, and Casts will have different icons based on their type.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.