Replies: 2 comments
-
Yo @flamendless did you see this? Any thoughts? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Oh problem with the mobile version it seems. Now i see it. Hmmm 9-slice is a good idea for theming. I am all for it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So my idea to make styling more customizable is through use of 9-sliced images.
Most of the widgets currently use simple rectangles in
line
andfill
mode. If we replaced those with 9-patches, making a new theme would become as simple as drawing an image with the new look, and defining a bunch of rectangles.If you want to get fancy you can even use a Canvas as the slice source and get animated styles "for free" (as in, no special support is required in the library).
This is, in my opinion, an elegant solution: it makes creating new styles very simple, does not require writing or changing code to create a theme, and it's relatively easy to implement.
It does require a good caching strategy though, because you don't want to recreate a bunch of SpriteBatches in every frame. That's probably the hardest part of the implementation.
Beta Was this translation helpful? Give feedback.
All reactions