You need to add the widgets that are created in the kv file.
Or better yet, embrace and learn kv. It is very powerful – and part of what makes kivy very productive.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/3dd6fd1d-8d8f-4a54-aaff-8ead0e879664o%40googlegroups.com.
You need to add the widgets that are created in the kv file.
Or better yet, embrace and learn kv. It is very powerful – and part of what makes kivy very productive.
From: Charly DELAROCHE
Sent: Wednesday, August 5, 2020 3:24 AM
To: Kivy users support
Subject: [kivy-users] Shader viewer - without .kv file
Hey,
I just started using kivy and it's awesome!
I've been trying to modify the shader editor example. I wanted to get rid of the .kv interface file and do everything programatically. My goal was just to run a shader and visualize it. However, I failed to do so. I can see the shader updating every frame, but nothing is displayed.
I tried to make my code as small as possible. Could you help me on this?
Thanks!
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
Take a look at the kv file, copied below. Notice in ShaderEditor (what you have called ShaderRoot), there are nested BoxLayouts with widgets… I don’t see any of this in your python code. Additionally the shader viewer sets the canvas color to white. I don’t see the canvas of the ShaderViewer being set.
See: https://kivy.org/doc/stable/api-kivy.uix.widget.html?highlight=canvas#basic-drawing
<ShaderEditor>:
viewer: viewer
BoxLayout:
BoxLayout:
orientation: 'vertical'
size_hint_x: None
width: 350
Label:
text: 'Fragment Shader'
size_hint_y: None
height: self.texture_size[1] + 10
CodeInput:
text: root.fs
lexer: GLShaderLexer()
on_text: root.fs = args[1]
Label:
text: 'Vertex Shader'
size_hint_y: None
height: self.texture_size[1] + 10
CodeInput:
text: root.vs
lexer: GLShaderLexer()
on_text: root.vs = args[1]
ShaderViewer:
id: viewer
canvas:
Color:
rgb: 1, 1, 1
Rectangle:
size: self.size
pos: self.pos
source: root.source
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/ca3dbbe1-7516-4442-b6bb-883a88d5b663o%40googlegroups.com.