0.2.0-dev Download ZIP
23 lines ·1.3 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="TextServerDummy" inherits="TextServerExtension" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A dummy text server that can't render text or manage fonts. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | A dummy [TextServer] interface that doesn't do anything. Useful for freeing up memory when rendering text is not needed, as text servers are resource-intensive. It can also be used for performance comparisons in complex GUIs to check the impact of text rendering. |
| 8 | A dummy text server is always available at the start of a project. Here's how to access it: |
| 9 | [codeblock] |
| 10 | var dummy_text_server = TextServerManager.find_interface("Dummy") |
| 11 | if dummy_text_server != null: |
| 12 | TextServerManager.set_primary_interface(dummy_text_server) |
| 13 | # If the other text servers are unneeded, they can be removed: |
| 14 | for i in TextServerManager.get_interface_count(): |
| 15 | var text_server = TextServerManager.get_interface(i) |
| 16 | if text_server != dummy_text_server: |
| 17 | TextServerManager.remove_interface(text_server) |
| 18 | [/codeblock] |
| 19 | The command line argument [code]--text-driver Dummy[/code] (case-sensitive) can be used to force the "Dummy" [TextServer] on any project. |
| 20 | </description> |
| 21 | <tutorials> |
| 22 | </tutorials> |
| 23 | </class> |