Debian Codegraph @

tools/castle-editor/README.md

raw symbols SCIP
1 # Castle Game Engine Editor
2
3 Create, build, edit Castle Game Engine projects.
4
5 See the [manual documenting the editor](https://castle-engine.io/manual_editor.php).
6
7 ## Contributing
8
9 ### Desktop scaling settings must be 125%
10
11 Use desktop settings with 125% font scaling when designing LCL forms.
12
13 Unfortunately, your personal desktop settings, at design-time, affect what is saved in LFM files, so it is best if we all use the same scaling, otherwise diffs to LFM files wildly change everything.
14
15 You can set such scaling e.g. by
16 - GNOME 3 _"Large fonts"_ accessibilty option,
17 - or use "GNOME Tweak Tool" that allows to explicitly configure scaling amount to 1.25,
18 - or adjusting Xorg dpi to 120 (96 * 1.25),
19 - Windows also allows to set 125% scaling - search in Preferences.
20
21 NOTE: Designing UI using CGE components like `TCastleButton` and other `TCastleXxx`, in CGE editor, doesn't have this issue. Everyone can use different scaling settings when working together on application using CGE UI components. But CGE editor, right now, is designed using LCL visual components.
22
23 ### Creating New Form
24
25 When creating a new Lazarus form, remember to:
26
27 - Save form class `TFooForm` (so it will have singleton `FooForm`) in unit name `FormFoo`.
28 - Adjust form's `Caption`.
29 - Adjust `TabStop` of all the controls inside, to make it comfortable to use keyboard.
30 - Use `AutoSize` and anchoring on all controls, to work regardless of theme font size. Do not assume that a text will have the same size as you have designed --- people use various themes and font types. Lazarus applications have a native look, and are expected to adjust to user's theme preferences.
31 - Consider using `AutoSize` on the form itself too.
32 - Adjust `BorderStyle` from `bsSizeable` to `bsSingle` if it's a small form that doesn't need to be resized (for larger forms, it's safer to allow resizing, even if you think you know the best size -- in case user will view it on a smaller monitor).
33 - Adjust `Position` from "as designed" (usually "default" or "main form center" is more sensible).
34 - Adjust `ShowInTaskBar`, this is important for selecting form on Windows in case of multiple windows.
35 - Make sure closing the form with "X" (Alt + F4) works OK.
36 - For a form you create manually, make sure it is freed at some point (preferably, not only at the end of application, if you can free it earlier; e.g. we don't want to have 100 of TProjectForm instances in memory after using the editor for a long time).
37
38 When adding new units, like forms, make sure you synchronize the custom editor template. Just
39
40 ```
41 cd ../build-tool/data/
42 ./custom_editor_template_rebuild.sh
43 ```
44
45 Units called `DesignXxx` are helper units for `FrameDesign`, i.e. for design editing.
46
47 ## License
48
49 The **Castle Game Engine Editor** is provided on the GNU GPL >= 2 license terms.
50 *Not* on more permissive terms of LGPL (with static linking exception) >= 2
51 (that are used for the rest of the Castle Game Engine).
52 See https://castle-engine.io/license for details.
53 This means that:
54
55 - You can use the editor to create your own closed-source programs,
56
57 - But you cannot fork the editor into a closed-source program (and distribute it publicly). If you want to fork, the fork has to be open-source as well, following GPL.
58
59 - You are of course free to extend Castle Game Engine editor for internal purposes (if you don't distribute it publicly, the GPL license terms don't concern you), or you can extend it publicly on terms of GPL (thus, keeping the whole work open-source).
60
61 When contributing (sending pull requests etc.) to the castle-editor source code,
62 you agree that your contributions may be used under either GPL
63 or a more permissive "LGPL with static linking exception" terms,
64 at the discretion of _Castle Game Engine Developers_.
65 _Castle Game Engine Developers_ are defined as _people with write (commit) access
66 to the official CGE version control repository_
67 (referred to from https://castle-engine.io/ , currently
68 https://github.com/castle-engine/castle-engine/ ).
69 The idea is that we sometimes want to move code from castle-editor to
70 the engine core, for technical reasons, and we want the freedom to do so.
71 Still, the complete editor stays GPL, as we don't apply this dual license to all our editor code, and complete editor is only GPL.