Add backgrounds to finish layout tutorial, add inline and remote CSS support with a default of browser.css which currently supports fonts and backgrounds

This commit is contained in:
csd4ni3l
2025-07-21 12:29:32 +02:00
parent a604a5dbd1
commit 09c1ce7f5a
8 changed files with 460 additions and 127 deletions

View File

@@ -1,4 +1,7 @@
import arcade.gui, arcade
from http_client.html_parser import CSSParser
button_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button.png"))
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button_hovered.png"))
DEFAULT_STYLE_SHEET = CSSParser(open("assets/css/browser.css").read()).parse()