-
Simdvo
Yes I want to try if it is faster than the way I'm using now.
-
Simdvo
Thank you the code works perfectly. But I have one last question does someone know how to send values to an URL? (post)?
-
-
Simdvo
Thank you, but when I try to run the code I getting the Error:
name 'MyScene' is not defined -
Simdvo
Does somebody know how to solve the problem that i mentioned before
-
Simdvo
from scene import * import sound import random import math import webbrowser import ui A = Action class MyWebView(ui.View): def __init__(self, url): self.wv = ui.WebView(frame=self.bounds) self.wv.frame = (10,10,350,250) self.wv.load_url(url) self.add_subview(self.wv) self.present() class MyScene (Scene): def setup(self): self.buttonl = SpriteNode('iob:arrow_left_b_256') self.buttonl.position = (70, 150) self.buttonl.scale = 0.7 self.add_child(self.buttonl) self.buttonr = SpriteNode('iob:arrow_right_b_256') self.buttonr.position = (300, 150) self.buttonr.scale = 0.7 self.add_child(self.buttonr) self.buttonf = SpriteNode('iob:arrow_up_b_256') self.buttonf.position = (185, 300) self.buttonf.scale = 0.7 self.add_child(self.buttonf) self.buttonh = SpriteNode('iob:arrow_down_b_256') self.buttonh.position = (70, 400) self.buttonh.scale = 0.7 self.add_child(self.buttonh) self.buttons = SpriteNode('iob:close_circled_256') self.buttons.position = (310, 410) self.buttons.scale = 0.5 self.add_child(self.buttons) def did_change_size(self): pass def touch_began(self, touch): for touch in self.touches.values(): if touch.location in self.buttonl.bbox: webbrowser.open("http://192.168.1.160/links") print("links") if touch.location in self.buttonr.bbox: webbrowser.open("http://192.168.1.160/rechts") print("rechts") if touch.location in self.buttonf.bbox: webbrowser.open("http://192.168.1.160/forne") print("forne") if touch.location in self.buttons.bbox: webbrowser.open("http://192.168.1.160/stop") print("stop") if touch.location in self.buttonh.bbox: webbrowser.open("http://192.168.1.160/zuruck") print("zurück") def touch_moved(self, touch): pass def touch_ended(self, touch): webbrowser.open("http://192.168.1.160/stop") if __name__ == '__main__': run(MyScene(), show_fps=False) wv = MyWebView('https://forum.omz-software.com')
-
Simdvo
If i start the programm the controllboard (buttons for forward,backward...) opens but then gets covered by the webside. The image is as big sa i set it but the background is black and coveres the whole screen.
-
Simdvo
when I copy that line in the code than i mm getting the error „‘MyWebView‘ object has noattribute wv“ in that line.
-
-
Simdvo
It is based on a. Esp32 and reackts if a url is triggered. It is programmed with the arduino ide(C++).