Пример #1
0
 public void Flash(float3 tint)
 {
     flashTicks     = 5;
     flashModifiers = TintModifiers.None;
     flashTint      = tint;
     flashAlpha     = null;
 }
Пример #2
0
 public void Flash(Color color, float alpha)
 {
     flashTicks     = 5;
     flashModifiers = TintModifiers.ReplaceColor;
     flashTint      = new float3(color.R, color.G, color.B) / 255f;
     flashAlpha     = alpha;
 }
Пример #3
0
 public FlashTarget(Actor target, Color color, float alpha = 0.5f, int count = 2, int interval = 2, int delay = 0)
     : this(target, count, interval, delay)
 {
     modifiers  = TintModifiers.ReplaceColor;
     tint       = new float3(color.R, color.G, color.B) / 255f;
     this.alpha = alpha;
 }
Пример #4
0
 public SpriteRenderable(Sprite sprite, WPos pos, WVec offset, int zOffset, PaletteReference palette, float scale, float alpha, float3 tint, TintModifiers tintModifiers, bool isDecoration)
 {
     this.sprite        = sprite;
     this.pos           = pos;
     this.offset        = offset;
     this.zOffset       = zOffset;
     this.palette       = palette;
     this.scale         = scale;
     this.tint          = tint;
     this.isDecoration  = isDecoration;
     this.tintModifiers = tintModifiers;
     this.alpha         = alpha;
 }
Пример #5
0
        public SpriteRenderable(Sprite sprite, WPos pos, WVec offset, int zOffset, PaletteReference palette, float scale, float alpha, float3 tint, TintModifiers tintModifiers, bool isDecoration)
        {
            this.sprite        = sprite;
            this.pos           = pos;
            this.offset        = offset;
            this.zOffset       = zOffset;
            this.palette       = palette;
            this.scale         = scale;
            this.tint          = tint;
            this.isDecoration  = isDecoration;
            this.tintModifiers = tintModifiers;
            this.alpha         = alpha;

            // PERF: Remove useless palette assignments for RGBA sprites
            // HACK: This is working around the fact that palettes are defined on traits rather than sequences
            // and can be removed once this has been fixed
            if (sprite.Channel == TextureChannel.RGBA && !(palette?.HasColorShift ?? false))
            {
                this.palette = null;
            }
        }
Пример #6
0
 public SpriteRenderable(Sprite sprite, WPos pos, WVec offset, int zOffset, PaletteReference palette, float scale, bool isDecoration, TintModifiers tintModifiers)
     : this(sprite, pos, offset, zOffset, palette, scale, 1f, float3.Ones, tintModifiers, isDecoration)
 {
 }