Eng:Scratch File Format (1.4)/User-class Objects


 * ''This is part of a technical description of the file format.

User-class objects are Objects which can change their attributes between Scratch versions such as Stage and Sprite. For example, the attribute for "lists" was only added in a later version.

Structure

 * : one byte describing the type of object.
 * : the version of the object, used to determine the value and type of the fields.
 * : how many fields the object has (as this may change between versions).
 * : length number of fields (Inline Values and Object References).

Technical details
In Scratch's Squeak source code, each User-class Object implements the instance methods,  , and   (found under the   category). Inspecting these methods shows what fields on these objects are serialised.

(When the serialization format of an object is changed, the methods  and   are changed, and the version number returned by objStreamVersion is increased by one.)

Each User-class object can have a maximum of 255 fields.

List of User-class Objects
Some of the classes inherit from others. All Morphs inherit the properties of a Morph, for example. Inherited/superclass fields are serialised to the file before subclass fields.

100 Morph


Base class for most UserObjects.

101 BorderedMorph
inherits Morph

102 RectangleMorph
inherits BorderedMorph

103 EllipseMorph
inherits BorderedMorph

104 AlignmentMorph
inherits RectangleMorph

105 StringMorph
inherits Morph

106 UpdatingStringMorph
inherits StringMorph

107 SimpleSliderMorph
inherits BorderedMorph

108 SimpleButtonMorph
inherits RectangleMorph

110 ImageMorph
inherits Morph

111 SketchMorph
inherits Morph

ScriptableScratchMorph
inherits Morph

Contains methods for scripting.

123 SensorBoardMorph
inherits Morph

Has a single extra field I have no idea what it does. Maybe somebody with a sensor board could check this?

124 ScratchSpriteMorph
inherits ScriptableScratchMorph

A Sprite object.

125 ScratchStageMorph
inherits ScriptableScratchMorph

The project Stage. Sprites are stored as an attribute. The stage is the root object of the Object Table in Sprite files and project file contents.

140 ChoiceArgMorph
inherits Morph

Unused.

141 ColorArgMorph
inherits Morph

Unused.

142 ExpressionArgMorph
inherits Morph

Unused.

145 SpriteArgMorph
inherits Morph

Unused.

147 BlockMorph
inherits Morph

Unused.

148 CommandBlockMorph
inherits BlockMorph

Unused.

149 CBlockMorph
inherits Morph

Unused.

151 HatBlockMorph
inherits Morph

Unused.

153 ScratchScriptsMorph
inherits BorderedMorph

Unused.

154 ScratchSliderMorph
inherits Morph

Unused.

155 WatcherMorph
inherits AlignmentMorph

A variable watcher.

157 SetterBlockMorph
inherits Morph

Unused.

158 EventHatMorph
inherits Morph

Unused.

160 VariableBlockMorph
inherits CommandBlockMorph

Unused.

162 ImageMedia
inherits ScratchMedia

163 MovieMedia
inherits ScratchMedia

Unused.

164 SoundMedia
inherits ScratchMedia

165 KeyEventHatMorph
inherits Morph

Unused.

166 BooleanArgMorph
inherits Morph

Unused.

167 EventTitleMorph
inherits Morph

Unused.

168 MouseClickEventHatMorph
inherits Morph

Unused.

169 ExpressionArgMorphWithMenu
inherits Morph

Unused.

170 ReporterBlockMorph
inherits Morph

Unused.

171 MultilineStringMorph
inherits Morph

Unused.

172 ToggleButton
inherits SimpleButtonMorph

Unused.

173 WatcherReadoutFrameMorph
inherits BorderedMorph

Unused.

174 WatcherSliderMorph
inherits SimpleSliderMorph

Unused.

175 ScratchListMorph
inherits BorderedMorph

A List object. List items are found in the  attribute.

176 ScrollingStringMorph
inherits Morph

Unused.