1

When I'm creating a Widget, and draw a circle on its canvas, the circle hasn't got a smooth outline. To fix that, I thought an EffectWidget would help me, as it once did with an ImageWidget on it. But enabling FXAAEffect on it after drawing a circle on its canvas didn't change anything. Is there a way, to directly enable AntiAliasing for Python Kivy's Canvas? (Even only for images)

d0n.key
  • 1,318
  • 2
  • 18
  • 39
  • Have you found a solution for this yet? If you have then please write and answer and accept it. – Tooniis Sep 01 '19 at 15:46
  • 1
    This question is over 4 years old. I haven't dealt with Kivy since then, and thus I could never try out the given answer from 2016. I don't remember how I dealt with the issue back then, but the answers to this question didn't help me, as you can read in my comments below them. – d0n.key Sep 04 '19 at 15:09

2 Answers2

0

The EffectWidget effects only work on child widgets, not its own canvas (due to technical limitations with how it works that are difficult to resolve).

Add a single child Widget and try drawing the circle on that instaed.

With kivy itself you can also enable in-hardware multisampling anti-aliasing, but I don't remember how, and I think it's probably already enabled (at least at a low level) if possible.

Edit: Like the following:

<YourEffectWidget>:
    Widget:
        canvas:
            Color:
                rgba: 1, 1, 0, 1
            Ellipse:
                pos: 100, 100
                size: 50, 50
inclement
  • 29,124
  • 4
  • 48
  • 60
  • "Add a single child Widget and try drawing the circle on that instaed" - I don't exactly understand your meaning. Like Every circle's got his own widget instead of one big canvas? That would work way too slow, as I'm coding for an AndroidGame – d0n.key Jul 23 '15 at 13:32
  • No, just add a Widget to the EffectWidget and use its canvas. I added an example. – inclement Jul 23 '15 at 13:49
  • 1
    Then post a working example demonstrating the issue. – inclement Jul 23 '15 at 15:38
0

I am using

effects: ew.HorizontalBlurEffect(size=0.1), ew.VerticalBlurEffect(size=0.1), ew.FXAAEffect()
wackazong
  • 474
  • 7
  • 18
  • Ok, thank you... But my question was posted over a year ago, and I don't even use Kivy anymore :D – d0n.key Oct 10 '16 at 19:24