switchTo

abstract fun switchTo(costume: T)

Changes the current costume of this sprite to the specified image. The costume must already be part of this sprite's costumes.

Parameters

costume

The image to change to.

Throws

IllegalArgumentException

if the provided image is not a costume of this sprite.