3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
HelloWorld3D.cpp

Generate the text primitive

// Generate the text primitive
#include <CoreAPI.h>
//@config: Debug
EXPORT
int main() {
coat::str name = "Hello world";
// get to sculpt room
coat::ui::toRoom("Sculpt");
// add new volume
auto current = coat::Scene::sculptRoot().addChild(name);
auto volume = current.Volume();
// turn to surface
volume.toSurface();
// draw the text name with default font name = "Times New Roman",
// width equals 200 and depth equals 10 and scale 2
coat::text().font(coat::Font()).string(name).width(200).depth(10).scale(2).add(volume);
return 0;
}
Definition CorePrimAPI.h:1643
SceneElement addChild(const char *name) const
add the child element of the same nature
static SceneElement sculptRoot()
get the root of all sculpt objects
void add(Volume &v)
add the prim into scene
prim & scale(float scale)
set the scale
text primitive
Definition CorePrimAPI.h:1735
text & font(const Font &f)
set the text font
text & depth(const float &d)
set the text depth in the pixels
text & string(const char *s)
set the text's string.
text & width(const float &w)
set the text width in the pixels
static void toRoom(const char *name, bool Force=false)
switch to the room
comms::cStr str
the string that is compatible with the 3DCoat engine, see the cStr
Definition CoreAPI.h:67