# rmp::Text

> A text the framework draws: translated when it was a literal, as it is when it was made at runtime.

Source: https://omardev29.github.io/rmp-docs/reference/classes/rmp-Text.html

class `#include <rmp/text.h>` [include/rmp/text.h:82](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/text.h#L82-L133)

class Text

A text the framework draws: translated when it was a literal, as it is when it was made at runtime.

### `Text`

template <std::size_t N> // NOLINTNEXTLINE(google-explicit-const

template <class S> requires(std::convertible_to<const S &, std::string_view> && !std::is_array_v<S>) Text(const S &runtime) // NOLINT(google-explicit-constructor): every string is a Text

Text(std::string_view key, const TextOptions &options)

Text(std::string_view key, std::initializer_list<TextArg> args, const TextOptions &options = {})

function [include/rmp/text.h:88](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/text.h#L88-L91)

A literal: translated, and the key is its own words. A reference to the array, so a literal and a runtime string are told apart by their type.

### `key`, `context`, `translated`, `args`

std::string_view key() const

std::string_view context() const

bool translated() const

std::span<const TextArg> args() const

function [include/rmp/text.h:106](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/text.h#L106)

What the tables are looked up by: the text as the code wrote it.

### `str`

std::string str() const

function [include/rmp/text.h:113](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/text.h#L113)

The text to show: translated into the current language, its plural form chosen and its placeholders filled.

### `id`

std::string id() const

function [include/rmp/text.h:117](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/text.h#L117)

The identity a widget keeps across languages: the key and its context, never the translation — so focus and hover survive [`rmp::lang::set()`](https://omardev29.github.io/rmp-docs/reference/namespaces/rmp-lang.html#set).
