ColorEffect.hx 786 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package textbox.effects;
  2. import flixel.util.FlxColor;
  3. class ColorEffect implements IEffect
  4. {
  5. private var active:Bool;
  6. public function new()
  7. {
  8. color = new FlxColor(FlxColor.WHITE);
  9. active = false;
  10. }
  11. public function reset(arg1:Int, arg2:Int, arg3:Int, nthCharacter:Int):Void
  12. {
  13. color.red = arg1;
  14. color.green = arg2;
  15. color.blue = arg3;
  16. }
  17. public function setActive(active:Bool):Void
  18. {
  19. this.active = active;
  20. }
  21. public function update(elapsed:Float):Void
  22. {
  23. }
  24. public function apply(text:Text):Void
  25. {
  26. if(!isActive())
  27. return;
  28. text.color = color;
  29. }
  30. public function isActive():Bool
  31. {
  32. return active;
  33. }
  34. var color:FlxColor;
  35. }