Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.33 KB

lighting.md

File metadata and controls

42 lines (31 loc) · 1.33 KB

Lighting

This is a GameComponent

Layer responsible for adding lighting to the game.

By setting the lightingColorGame property on BonfireWidget you automatically enable this lighting system. To add light to objects, just add the Lighting mixin to the component and configure it using setupLighting() method:

class MyCustomDecoration extends GameDecoration with Lighting {
  MyCustomDecoration(Position position)
      : super.withAnimation(
          Future<SpriteAnimation>(),
          size: Vector2(32,32),
          position: position,
        ){
          setupLighting(
            LightingConfig(
              radius: width * 1.5,
              color: Colors.transparent,
              // blurBorder: 20, // this is a default value
              // type: LightingType.circle, // this is a default value
              // useComponentAngle: false, // this is a default value. When true light rotate together component when change `angle` param.
            ),
          );
        }

}

GameColorFilter

You can apply color filter in your game programmatically.

BlendMode and Color

  gameRef.colorFilter.animateTo(Colors.blue, BlendMode.colorBurn);