Is that possible to create and apply StyleSheet instance during runtime? I want to create following style and apply it to hole VisualComponent tree during runtime:
* {
cursor: SomeProcedural2DTexture;
}
Is that possible to create and apply StyleSheet instance during runtime? I want to create following style and apply it to hole VisualComponent tree during runtime:
* {
cursor: SomeProcedural2DTexture;
}
Hello,
This is not possible at the moment.
May I suggest that use the C# API to change element styles instead?
E.g. element.style.cursor = new Cursor() { texture = myTexture }
Hey @antoine-unity !
Since it has been more than a year, since your reply: Has there been any progress made on providing the possibility to create StyleSheets at runtime?
If you want to create StyleSheet in runtime such as ScriptedImporter in Editor, the answer is no.
I got the answer about this yesterday from forum manager.
https://forum.unity.com/threads/loading-uxml-and-uss-from-text-in-runtime.1200964/#post-7678849
Thx, but I would be fine with creating a StyleSheet object, so there is no need to involve the string parser.