     return if not @paths
     @paths.parent.removeChild @paths
     @paths = null
+    
+    
+    
+  #- Screenshot
 
   screenshot: (scale=0.25, format='image/jpeg', quality=0.8, zoom=2) ->
     # Quality doesn't work with image/png, just image/jpeg and image/webp

    screenshot.src = imageData
    @stage.uncache()
    imageData

    @coordinateGrid.showGrid() if @world.showGrid or @options.grid
    @coordinateDisplay ?= new CoordinateDisplay camera: @camera, layer: @surfaceTextLayer if @world.showCoordinates or @options.coords

  hookUpChooseControls: ->
    chooserOptions = stage: @stage, surfaceLayer: @surfaceLayer, camera: @camera, restrictRatio: @options.choosing is 'ratio-region'
    klass = if @options.choosing is 'point' then PointChooser else RegionChooser
    @chooser = new klass chooserOptions

  initAudio: ->
    @musicPlayer = new MusicPlayer()



  #- Setting the world
    
  setWorld: (@world) ->
    @worldLoaded = true
    lastFrame = Math.min(@getCurrentFrame(), @world.frames.length - 1)
    @world.getFrame(lastFrame).restoreState() unless @options.choosing
    @spriteBoss.world = @world

    @showLevel()
    @updateState true if @loaded
    @onFrameChanged()
    Backbone.Mediator.publish 'surface:world-set-up', {world: @world}

  showLevel: ->
    return if @destroyed
    return if @loaded
    @loaded = true
    @spriteBoss.createMarks()
