本文整理汇总了C++中Label::add_style_override方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::add_style_override方法的具体用法?C++ Label::add_style_override怎么用?C++ Label::add_style_override使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::add_style_override方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _update_graph
//.........这里部分代码省略.........
if (default_value.get_type() != Variant::NIL) { // only a label
Button *button = memnew(Button);
hb->add_child(button);
button->connect("pressed", this, "_edit_port_default_input", varray(button, nodes[n_i], i));
switch (default_value.get_type()) {
case Variant::COLOR: {
button->set_custom_minimum_size(Size2(30, 0) * EDSCALE);
button->connect("draw", this, "_draw_color_over_button", varray(button, default_value));
} break;
case Variant::INT:
case Variant::REAL: {
button->set_text(String::num(default_value, 4));
} break;
case Variant::VECTOR3: {
Vector3 v = default_value;
button->set_text(String::num(v.x, 3) + "," + String::num(v.y, 3) + "," + String::num(v.z, 3));
} break;
default: {}
}
}
if (i == 0 && custom_editor) {
hb->add_child(custom_editor);
custom_editor->set_h_size_flags(SIZE_EXPAND_FILL);
} else {
if (valid_left) {
Label *label = memnew(Label);
label->set_text(name_left);
label->add_style_override("normal", label_style); //more compact
hb->add_child(label);
}
hb->add_spacer();
if (valid_right) {
Label *label = memnew(Label);
label->set_text(name_right);
label->set_align(Label::ALIGN_RIGHT);
label->add_style_override("normal", label_style); //more compact
hb->add_child(label);
}
}
if (valid_right && edit_type->get_selected() == VisualShader::TYPE_FRAGMENT) {
TextureButton *preview = memnew(TextureButton);
preview->set_toggle_mode(true);
preview->set_normal_texture(get_icon("GuiVisibilityHidden", "EditorIcons"));
preview->set_pressed_texture(get_icon("GuiVisibilityVisible", "EditorIcons"));
preview->set_v_size_flags(SIZE_SHRINK_CENTER);
if (vsnode->get_output_port_for_preview() == i) {
preview->set_pressed(true);
}
preview->connect("pressed", this, "_preview_select_port", varray(nodes[n_i], i), CONNECT_DEFERRED);
hb->add_child(preview);
}
node->add_child(hb);