readImageContainer

This function reads the Aseprite image file, decodes its content and stores selected details into an ImageDataContainer object.

With the props parameter it is possible to selectively load data from an Aseprite image file. If props are not defined than the whole image will be read with all layers and slices.

props can be defined as: (name, type)

  • "layers", String: With this property it is possible to define layer names (comma separated string) which shall be read from the Aseprite file. Other layers will be ignored.

  • "disableSlicing", Boolean: With this it is possible to switch of slicing of the Aseprite image even if slices are defined in the image. This can be used to selectively slice only specific layers. While all other layers are not sliced.

  • "useSlicePosition", Boolean: With this it is possible to set the position of a sliced image object relative to the original image. This is useful if the sliced image should be placed relative to another sliced image in the view which uses these images. This property has only an effect if "disableSlicing" is set to "false".

Example for props:

val props = ImageDecodingProps(this.baseName, extra = ExtraTypeCreate())
props.setExtra("layers", "layer_1,layer_2,layer_3")
props.setExtra("disableSlicing", false)
props.setExtra("useSlicePosition", true)