API Reference › Screen — drawing › Screen.blend_mode
method

Screen.blend_mode

Screen.blend_mode(mode)

Selects how drawn pixels combine with the framebuffer: 0 replaces (the default), 1 adds colours channel-wise and clamps at 255. Additive blending is how you draw glows, fire, lasers, and light — stack several bright shapes and the overlaps brighten toward white. Set it back to 0 when done.

Example

program Demo {
  handler DrawWorld phase Render {
    Screen.blend_mode(1)
    Screen.fill_circle(x: 150, y: 120, radius: 30, color: Color.rgb(80, 20, 0))
    Screen.fill_circle(x: 170, y: 120, radius: 30, color: Color.rgb(80, 20, 0))
    Screen.blend_mode(0)
    Screen.show()
  }
}
← All symbols