Modify the image of the stage

From Director Online Wiki
Jump to: navigation, search

Did you know you can directly modify the image of the stage?

-- Lingo example
 
on startMovie
  myStage = _movie.stage
  myImage = member("myImage").image
  -- using copyPixels
  myStage.image.copyPixels(myImage, myImage.rect, myImage.rect)
  -- using setPixel
  myStage.image.setPixel(10,10,rgb(255,0,0))
  -- using draw
  myStage.image.draw(0, 20, 80, 20, [#shapeType:#line, #lineSize:3, #color:rgb(255, 0 ,0)])
  -- using fill
  myStage.image.fill(10,30,40,40, [#shapeType:#rect, #lineSize:3, #color:rgb(255, 0 ,0), #bgColor:rgb(0, 255 ,0)])
end