FaText
🟡 Needs container
🟡 Doesn't accept child/children
API
pub fn fa_text<'a>(builder: &'a mut FamiqWidgetBuilder, value: &str) -> FaTextBuilder<'a> {
// ..
}
Usage
let text = fa_text(&mut builder, "Some text").build();
Return Entity of the widget which must be used inside FaContainer widget.
Example
let boss = fa_text(&mut builder, "Hello Boss").id("#boss-txt").build();
let mom = fa_text(&mut builder, "Hello Mom").build();
fa_container(&mut builder).children([boss, mom]).build();

Resource
pub struct FaTextResource;
-
FaTextResourcecan be used to get & update specific text widget's value by either itsidorentity.Available methods:
get_value_by_id: getfa_textvalue by id, returnempty stringif id doesn't exist.get_value_by_entity: getfa_textvalue by entity, returnempty stringif entity doesn't exist.update_value_by_id: updatefa_textvalue by id.update_value_by_entity: updatefa_textvalue by entity.
Example of using
FaTextResourcefn my_system(mut text_res: ResMut<FaTextResource>) { // some logic .. // get value let text = text_res.get_value_by_id("#boss-txt"); // update value text_res.update_value_by_id("#boss-txt", "Good morning Boss"); }