C++ tutorial: Remove inline code for the memory tile chapter

This commit is contained in:
Simon Hausmann 2021-06-17 15:34:28 +02:00
parent 031acd77d3
commit 57d25c6d9b
2 changed files with 27 additions and 15 deletions

View file

@ -0,0 +1,26 @@
/* LICENSE BEGIN
This file is part of the SixtyFPS Project -- https://sixtyfps.io
Copyright (c) 2020 Olivier Goffart <olivier.goffart@sixtyfps.io>
Copyright (c) 2020 Simon Hausmann <simon.hausmann@sixtyfps.io>
SPDX-License-Identifier: GPL-3.0-only
This file is also available under commercial licensing terms.
Please contact info@sixtyfps.io for more information.
LICENSE END */
// ANCHOR: main_window
MemoryTile := Rectangle {
width: 64px;
height: 64px;
background: #3960D5;
Image {
source: @image-url("icons/bus.png");
width: parent.width;
height: parent.height;
}
}
MainWindow := Window {
MemoryTile {}
}
// ANCHOR_END: main_window

View file

@ -10,21 +10,7 @@ mixing values with different units attached to them.
We copy the following code into the `memory.60` file:
```60
MemoryTile := Rectangle {
width: 64px;
height: 64px;
background: #3960D5;
Image {
source: @image-url("icons/bus.png");
width: parent.width;
height: parent.height;
}
}
MainWindow := Window {
MemoryTile {}
}
{{#include memory_tile.60:main_window}}
```
Inside the <span class="hljs-built_in">Rectangle</span> we place an <span class="hljs-built_in">Image</span> element that