SpotLight

Spotlight that emits a cone of light, useful for flashlights or theater spot effects.

SpotLight

SpotLight(**kwargs)

Located in ursina/lights.py

Overview

SpotLight casts light in a cone shape from its position. You can point it at targets to simulate flashlights, stage lights or headlights.

Constructor Arguments

ArgumentTypeDefaultDescription
**kwargsanyAny Light or Entity attributes (position, color, etc.).

Example Usage

from ursina import *
from ursina.shaders import lit_with_shadows_shader

app = Ursina()
EditorCamera()

# plane and cube using shadow shader
Entity(model='plane', scale=10, shader=lit_with_shadows_shader)
Entity(model='cube', y=1, shader=lit_with_shadows_shader)

# spotlight shining downwards
spot = SpotLight(color=color.white)
spot.position = (0, 3, 0)
spot.look_at((0, 0, 0))

app.run()