EditCreateTile
This function creates a new tile for 2D drawing. Tiles can be rectangles or text.
Syntax
- shared_ptr<Tile> CreateTile(shared_ptr<Camera> camera, const float width, const float height, const bool wireframe = false)
- shared_ptr<Tile> CreateTile(shared_ptr<Camera> camera, const Vec2& size, const bool wireframe = false)
- shared_ptr<Tile> CreateTile(shared_ptr<Camera> camera, shared_ptr<Font> font, const WString& text, const int fontsize = 14, const TextAlignment alignment = TEXT_LEFT, const float linespacing = 1.5f)
- shared_ptr<Tile> CreateTile(shared_ptr<World> world, const float width, const float height, const bool wireframe = false)
- shared_ptr<Tile> CreateTile(shared_ptr<World> world, const Vec2& size, const bool wireframe = false)
- shared_ptr<Tile> CreateTile(shared_ptr<World> world, shared_ptr<Font> font, const WString& text, const int fontsize = 14, const TextAlignment alignment = TEXT_LEFT, const float linespacing = 1.5f)
| Parameter |
Description |
| camera |
camera the tile will appear on |
| world |
world the tile will appear in, rendered last after all cameras are drawn |
| size, width, height |
size of a rectangle tile |
| wireframe |
if set to true a line rectangle will be created, otherwise a solid rectangle will be created |
| font |
font to create a text tile with |
| fontsize |
font size to create a text tile with |
| alignment |
text alignment, can be any combination of TEXT_LEFT, TEXT_CENTER, TEXT_RIGHT, TEXT_TOP, TEXT_MIDDLE, and TEXT_BOTTOM |
| linespacing |
text spacing between multiple lines of text |
Remarks
The text alignment flags can be used to control the orientation of the text around the tile handle. The default orientation is top-left.

Returns
Returns a new tile.