Replacing the type of an object

When you drop a Blocks view item into the scene, a new object is created. If the item you drop is an image or atlas frame, it creates an Image object.

However, you can change the type of the Image object to another, like a Sprite or TileSprite. You can convert any type of object to any other type. We name it object type replacement.

To replace the type, execute the Replace Type command that is shown in the Type sub-menu of the context menu. That command opens the Replace Type dialog. The dialog shows the different types supported by the editor, including your prefabs. Select the new type and press Replace.

For example, you can convert a Text object to a BitmapText:

  1. Select the Text object, open the context menu and launch the Replace Type dialog:

    Open the Replace Type dialog.
  2. In the Replace Type dialog, select the BitmapText type. It opens the Select Bitmap Font dialog. Select the desired font for the new object (you cannot create a BitmapText object without a font):

    Select the font for the new BitmapText.
  3. Finally, the object is converted to a BitmapText. Note the properties shared by both types are conserved the same. The Text property is an example of that:

    Converted to BitmapText.

Keeping the original texture

The Replace Type dialog has the option of keep the original texture when you are replacing an image object with a prefab type. By default, the object will get the texture of the prefab. However, if you select the Keep the original texture option, after the type replacing, the object will unlock the texture property and use the original texture.

The Keep original texture parameter.