本文整理汇总了C++中set_child_rect函数的典型用法代码示例。如果您正苦于以下问题:C++ set_child_rect函数的具体用法?C++ set_child_rect怎么用?C++ set_child_rect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_child_rect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: memnew
EditorHelpSearch::EditorHelpSearch(EditorNode *p_editor) {
editor=p_editor;
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
HBoxContainer *sb_hb = memnew( HBoxContainer);
search_box = memnew( LineEdit );
sb_hb->add_child(search_box);
search_box->set_h_size_flags(SIZE_EXPAND_FILL);
Button *sb = memnew( Button("Search"));
sb->connect("pressed",this,"_update_search");
sb_hb->add_child(sb);
vbc->add_margin_child("Search:",sb_hb);
search_box->connect("text_changed",this,"_text_changed");
search_box->connect("input_event",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child("Matches:",search_options,true);
get_ok()->set_text("View");
get_ok()->set_disabled(true);
register_text_enter(search_box);
set_hide_on_ok(false);
search_options->connect("item_activated",this,"_confirmed");
set_title("Search Classes");
// search_options->set_hide_root(true);
}
开发者ID:HiddenDark,项目名称:godot,代码行数:27,代码来源:editor_help.cpp
示例2: set_title
ReparentDialog::ReparentDialog() {
set_title(TTR("Reparent Node"));
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
tree = memnew( SceneTreeEditor(false) );
tree->set_show_enabled_subscene(true);
vbc->add_margin_child(TTR("Reparent Location (Select new Parent):"),tree,true);
tree->get_scene_tree()->connect("item_activated",this,"_reparent");
//Label *label = memnew( Label );
//label->set_pos( Point2( 15,8) );
//label->set_text("Reparent Location (Select new Parent):");
keep_transform = memnew( CheckBox );
keep_transform->set_text(TTR("Keep Global Transform"));
keep_transform->set_pressed(true);
vbc->add_child(keep_transform);
//vbc->add_margin_child("Options:",node_only);;
//cancel->connect("pressed", this,"_cancel");
get_ok()->set_text(TTR("Reparent"));
}
开发者ID:lonesurvivor,项目名称:godot,代码行数:32,代码来源:reparent_dialog.cpp
示例3: EditorMeshImportDialog
EditorMeshImportDialog(EditorMeshImportPlugin *p_plugin) {
plugin=p_plugin;
set_title(TTR("Single Mesh Import"));
set_hide_on_ok(false);
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer );
vbc->add_margin_child(TTR("Source Mesh(es):"),hbc);
import_path = memnew( LineEdit );
import_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(import_path);
Button * import_choose = memnew( Button );
import_choose->set_text(" .. ");
hbc->add_child(import_choose);
import_choose->connect("pressed", this,"_browse");
hbc = memnew( HBoxContainer );
vbc->add_margin_child(TTR("Target Path:"),hbc);
save_path = memnew( LineEdit );
save_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(save_path);
Button * save_choose = memnew( Button );
save_choose->set_text(" .. ");
hbc->add_child(save_choose);
save_choose->connect("pressed", this,"_browse_target");
file_select = memnew( EditorFileDialog );
file_select->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
file_select->set_mode(EditorFileDialog::MODE_OPEN_FILES);
file_select->add_filter("*.obj ; Wavefront OBJ");
add_child(file_select);
file_select->connect("files_selected", this,"_choose_files");
save_select = memnew( EditorDirDialog );
add_child(save_select);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
get_ok()->set_text(TTR("Import"));
error_dialog = memnew( AcceptDialog );
add_child(error_dialog);
options = memnew( _EditorMeshImportOptions );
option_editor = memnew( PropertyEditor );
option_editor->hide_top_label();
vbc->add_margin_child(TTR("Options:"),option_editor,true);
}
开发者ID:03050903,项目名称:godot,代码行数:60,代码来源:editor_mesh_import_plugin.cpp
示例4: memnew
PropertySelector::PropertySelector() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
search_box = memnew( LineEdit );
vbc->add_margin_child(TTR("Search:"),search_box);
search_box->connect("text_changed",this,"_text_changed");
search_box->connect("input_event",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child(TTR("Matches:"),search_options,true);
get_ok()->set_text(TTR("Open"));
get_ok()->set_disabled(true);
register_text_enter(search_box);
set_hide_on_ok(false);
search_options->connect("item_activated",this,"_confirmed");
search_options->connect("cell_selected",this,"_item_selected");
search_options->set_hide_root(true);
search_options->set_hide_folding(true);
help_bit = memnew( EditorHelpBit );
vbc->add_margin_child(TTR("Description:"),help_bit);
help_bit->connect("request_hide",this,"_closed");
}
开发者ID:FEDE0D,项目名称:godot,代码行数:27,代码来源:property_selector.cpp
示例5: NewProjectDialog
NewProjectDialog() {
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
set_child_rect(vb);
Label* l = memnew(Label);
l->set_text("Project Path:");
vb->add_child(l);
pp=l;
project_path = memnew( LineEdit );
MarginContainer *mc = memnew( MarginContainer );
vb->add_child(mc);
HBoxContainer *pphb = memnew( HBoxContainer );
mc->add_child(pphb);
pphb->add_child(project_path);
project_path->set_h_size_flags(SIZE_EXPAND_FILL);
Button* browse = memnew( Button );
pphb->add_child(browse);
browse->set_text("Browse");
browse->connect("pressed", this,"_browse_path");
l = memnew(Label);
l->set_text("Project Name:");
l->set_pos(Point2(5,50));
vb->add_child(l);
pn=l;
project_name = memnew( LineEdit );
mc = memnew( MarginContainer );
vb->add_child(mc);
mc->add_child(project_name);
project_name->set_text("New Game Project");
l = memnew(Label);
l->set_text("That's a BINGO!");
vb->add_child(l);
error=l;
l->add_color_override("font_color",Color(1,0.4,0.3,0.8));
l->set_align(Label::ALIGN_CENTER);
get_ok()->set_text("Create");
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
project_path->set_text(d->get_current_dir());
memdelete(d);
fdialog = memnew( FileDialog );
add_child(fdialog);
fdialog->set_access(FileDialog::ACCESS_FILESYSTEM);
project_name->connect("text_changed", this,"_text_changed");
project_path->connect("text_changed", this,"_path_text_changed");
fdialog->connect("dir_selected", this,"_path_selected");
fdialog->connect("file_selected", this,"_file_selected");
set_hide_on_ok(false);
import_mode=false;
}
开发者ID:0871087123,项目名称:godot,代码行数:60,代码来源:project_manager.cpp
示例6: memnew
OrphanResourcesDialog::OrphanResourcesDialog(){
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
files = memnew( Tree );
files->set_columns(2);
files->set_column_titles_visible(true);
files->set_column_min_width(1,100);
files->set_column_expand(0,true);
files->set_column_expand(1,false);
files->set_column_title(0,"Resource");
files->set_column_title(1,TTR("Owns"));
files->set_hide_root(true);
vbc->add_margin_child(TTR("Resources Without Explicit Ownership:"),files,true);
set_title(TTR("Orphan Resource Explorer"));
delete_confirm = memnew( ConfirmationDialog );
delete_confirm->set_text(TTR("Delete selected files?"));
get_ok()->set_text(TTR("Delete"));
add_child(delete_confirm);
dep_edit = memnew( DependencyEditor );
add_child(dep_edit);
files->connect("button_pressed",this,"_button_pressed");
delete_confirm->connect("confirmed",this,"_delete_confirm");
set_hide_on_ok(false);
}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:27,代码来源:dependency_editor.cpp
示例7: memnew
CreateDialog::CreateDialog() {
HSplitContainer *hbc = memnew(HSplitContainer);
add_child(hbc);
set_child_rect(hbc);
VBoxContainer *lvbc = memnew(VBoxContainer);
hbc->add_child(lvbc);
lvbc->set_custom_minimum_size(Size2(150, 0) * EDSCALE);
favorites = memnew(Tree);
lvbc->add_margin_child(TTR("Favorites:"), favorites, true);
favorites->set_hide_root(true);
favorites->set_hide_folding(true);
favorites->connect("cell_selected", this, "_favorite_selected");
favorites->connect("item_activated", this, "_favorite_activated");
favorites->set_drag_forwarding(this);
recent = memnew(Tree);
lvbc->add_margin_child(TTR("Recent:"), recent, true);
recent->set_hide_root(true);
recent->set_hide_folding(true);
recent->connect("cell_selected", this, "_history_selected");
recent->connect("item_activated", this, "_history_activated");
VBoxContainer *vbc = memnew(VBoxContainer);
hbc->add_child(vbc);
vbc->set_h_size_flags(SIZE_EXPAND_FILL);
HBoxContainer *search_hb = memnew(HBoxContainer);
search_box = memnew(LineEdit);
search_box->set_h_size_flags(SIZE_EXPAND_FILL);
search_hb->add_child(search_box);
favorite = memnew(Button);
favorite->set_toggle_mode(true);
search_hb->add_child(favorite);
favorite->connect("pressed", this, "_favorite_toggled");
vbc->add_margin_child(TTR("Search:"), search_hb);
search_box->connect("text_changed", this, "_text_changed");
search_box->connect("input_event", this, "_sbox_input");
search_options = memnew(Tree);
vbc->add_margin_child(TTR("Matches:"), search_options, true);
get_ok()->set_text(TTR("Create"));
get_ok()->set_disabled(true);
register_text_enter(search_box);
set_hide_on_ok(false);
search_options->connect("item_activated", this, "_confirmed");
search_options->connect("cell_selected", this, "_item_selected");
// search_options->set_hide_root(true);
base_type = "Object";
help_bit = memnew(EditorHelpBit);
vbc->add_margin_child(TTR("Description:"), help_bit);
help_bit->connect("request_hide", this, "_closed");
}
开发者ID:allkhor,项目名称:godot,代码行数:55,代码来源:create_dialog.cpp
示例8: memnew
EditorReImportDialog::EditorReImportDialog() {
tree = memnew( Tree );
add_child(tree);
tree->set_hide_root(true);
set_child_rect(tree);
set_title("Re-Import Changed Resources");
error = memnew( AcceptDialog);
add_child(error);
}
开发者ID:0871087123,项目名称:godot,代码行数:11,代码来源:editor_reimport_dialog.cpp
示例9: set_title
SceneTreeDialog::SceneTreeDialog() {
set_title(TTR("Select a Node"));
tree = memnew( SceneTreeEditor(false,false) );
add_child(tree);
set_child_rect(tree);
tree->get_scene_tree()->connect("item_activated",this,"_select");
}
开发者ID:WalasPrime,项目名称:godot,代码行数:11,代码来源:scene_tree_editor.cpp
示例10: memnew
EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
VBoxContainer *vbox = memnew( VBoxContainer );
add_child(vbox);
set_child_rect(vbox);
HBoxContainer *hbox = memnew( HBoxContainer);
vbox->add_child(hbox);
vbox->add_constant_override("separation",15);
VBoxContainer *desc_vbox = memnew( VBoxContainer );
hbox->add_child(desc_vbox);
hbox->add_constant_override("separation",15);
item = memnew( EditorAssetLibraryItem );
desc_vbox->add_child(item);
desc_vbox->set_custom_minimum_size(Size2(300,0));
PanelContainer * desc_bg = memnew( PanelContainer );
desc_vbox->add_child(desc_bg);
desc_bg->set_v_size_flags(SIZE_EXPAND_FILL);
description = memnew( RichTextLabel );
description->connect("meta_clicked",this,"_link_click");
//desc_vbox->add_child(description);
desc_bg->add_child(description);
desc_bg->add_style_override("panel",get_stylebox("normal","TextEdit"));
preview = memnew( TextureFrame );
preview->set_custom_minimum_size(Size2(640,345));
hbox->add_child(preview);
PanelContainer * previews_bg = memnew( PanelContainer );
vbox->add_child(previews_bg);
previews_bg->set_custom_minimum_size(Size2(0,85));
previews_bg->add_style_override("panel",get_stylebox("normal","TextEdit"));
previews = memnew( ScrollContainer );
previews_bg->add_child(previews);
previews->set_enable_v_scroll(false);
previews->set_enable_h_scroll(true);
preview_hb = memnew( HBoxContainer );
preview_hb->set_v_size_flags(SIZE_EXPAND_FILL);
previews->add_child(preview_hb);
get_ok()->set_text("Install");
get_cancel()->set_text("Close");
}
开发者ID:Blake-Hudson,项目名称:godot,代码行数:53,代码来源:asset_library_editor_plugin.cpp
示例11: memnew
EditorHelpIndex::EditorHelpIndex() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
class_list = memnew( Tree );
vbc->add_margin_child("Class List: ",class_list,true);
class_list->set_v_size_flags(SIZE_EXPAND_FILL);
class_list->connect("item_activated",this,"_tree_item_selected");
get_ok()->set_text("Open");
}
开发者ID:masoudbh3,项目名称:godot,代码行数:17,代码来源:editor_help.cpp
示例12: memnew
DependencyEditorOwners::DependencyEditorOwners(EditorNode *p_editor) {
editor = p_editor;
file_options = memnew(PopupMenu);
add_child(file_options);
file_options->connect("item_pressed", this, "_file_option");
owners = memnew(ItemList);
owners->set_select_mode(ItemList::SELECT_SINGLE);
owners->connect("item_rmb_selected", this, "_list_rmb_select");
owners->connect("item_activated", this, "_select_file");
owners->set_allow_rmb_select(true);
add_child(owners);
set_child_rect(owners);
}
开发者ID:allkhor,项目名称:godot,代码行数:17,代码来源:dependency_editor.cpp
示例13: set_title
ConnectionsDialog::ConnectionsDialog(EditorNode *p_editor) {
editor=p_editor;
set_title("Edit Connections..");
set_hide_on_ok(false);
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
tree = memnew( Tree );
tree->set_columns(1);
tree->set_select_mode(Tree::SELECT_ROW);
tree->set_hide_root(true);
vbc->add_margin_child("Connections:",tree,true);
// add_child(tree);
connect_dialog = memnew( ConnectDialog );
connect_dialog->set_as_toplevel(true);
add_child(connect_dialog);
remove_confirm = memnew( ConfirmationDialog );
remove_confirm->set_as_toplevel(true);
add_child(remove_confirm);
/*
node_only->set_anchor( MARGIN_TOP, ANCHOR_END );
node_only->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
node_only->set_anchor( MARGIN_RIGHT, ANCHOR_END );
node_only->set_begin( Point2( 20,51) );
node_only->set_end( Point2( 10,44) );
*/
remove_confirm->connect("confirmed", this,"_remove_confirm");
connect_dialog->connect("connected", this,"_connect");
tree->connect("item_selected", this,"_something_selected");
get_cancel()->set_text("Close");
}
开发者ID:Ranmus,项目名称:godot,代码行数:44,代码来源:connections_dialog.cpp
示例14: memnew
EditorQuickOpen::EditorQuickOpen() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
search_box = memnew( LineEdit );
vbc->add_margin_child("Search:",search_box);
search_box->connect("text_changed",this,"_text_changed");
search_box->connect("input_event",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child("Matches:",search_options,true);
get_ok()->set_text("Open");
get_ok()->set_disabled(true);
register_text_enter(search_box);
set_hide_on_ok(false);
search_options->connect("item_activated",this,"_confirmed");
search_options->set_hide_root(true);
}
开发者ID:ShadowKyogre,项目名称:godot,代码行数:19,代码来源:quick_open.cpp
示例15: memnew
EditorAssetInstaller::EditorAssetInstaller() {
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
set_child_rect(vb);
tree = memnew( Tree );
vb->add_margin_child("Package Contents:",tree,true);
tree->connect("item_edited",this,"_item_edited");
error = memnew( AcceptDialog) ;
add_child(error);
get_ok()->set_text("Install");
set_title("Package Installer");
updating=false;
set_hide_on_ok(true);
}
开发者ID:03050903,项目名称:godot,代码行数:19,代码来源:editor_asset_installer.cpp
示例16: memnew
CreateDialog::CreateDialog() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
search_box = memnew( LineEdit );
vbc->add_margin_child(TTR("Search:"),search_box);
search_box->connect("text_changed",this,"_text_changed");
search_box->connect("input_event",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child(TTR("Matches:"),search_options,true);
get_ok()->set_text(TTR("Create"));
get_ok()->set_disabled(true);
register_text_enter(search_box);
set_hide_on_ok(false);
search_options->connect("item_activated",this,"_confirmed");
// search_options->set_hide_root(true);
base_type="Object";
}
开发者ID:SasoriOlkof,项目名称:godot,代码行数:21,代码来源:create_dialog.cpp
示例17: set_title
EditorSubScene::EditorSubScene() {
set_title("Select Sub-Scene..");
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
set_child_rect(vb);
HBoxContainer *hb = memnew( HBoxContainer );
path = memnew( LineEdit );
path->connect("text_entered",this,"_path_changed");
hb->add_child(path);
path->set_h_size_flags(SIZE_EXPAND_FILL);
Button *b = memnew( Button );
b->set_text(" .. ");
hb->add_child(b);
b->connect("pressed",this,"_path_browse");
vb->add_margin_child("Scene Path:",hb);
tree = memnew( Tree );
tree->set_v_size_flags(SIZE_EXPAND_FILL);
vb->add_margin_child("Import From Node:",tree)->set_v_size_flags(SIZE_EXPAND_FILL);
file_dialog = memnew( FileDialog );
List<String> extensions;
ResourceLoader::get_recognized_extensions_for_type("PackedScene",&extensions);
for(List<String>::Element *E = extensions.front();E;E=E->next() ) {
file_dialog->add_filter("*."+E->get());
}
file_dialog->set_mode(FileDialog::MODE_OPEN_FILE);
add_child(file_dialog);
file_dialog->connect("file_selected",this,"_path_selected");
scene=NULL;
set_hide_on_ok(false);
}
开发者ID:0871087123,项目名称:godot,代码行数:39,代码来源:editor_sub_scene.cpp
示例18: memnew
EditorHelpIndex::EditorHelpIndex() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
search_box = memnew( LineEdit );
vbc->add_margin_child(TTR("Search:"), search_box);
search_box->set_h_size_flags(SIZE_EXPAND_FILL);
register_text_enter(search_box);
search_box->connect("text_changed", this, "_text_changed");
search_box->connect("input_event", this, "_sbox_input");
class_list = memnew( Tree );
vbc->add_margin_child(TTR("Class List:")+" ", class_list, true);
class_list->set_v_size_flags(SIZE_EXPAND_FILL);
class_list->connect("item_activated",this,"_tree_item_selected");
get_ok()->set_text(TTR("Open"));
}
开发者ID:P-GLEZ,项目名称:godot,代码行数:23,代码来源:editor_help.cpp
示例19: EditorTranslationImportDialog
EditorTranslationImportDialog(EditorTranslationImportPlugin *p_plugin) {
plugin=p_plugin;
set_title(TTR("Import Translation"));
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
VBoxContainer *csvb = memnew( VBoxContainer );
HBoxContainer *hbc = memnew( HBoxContainer );
csvb->add_child(hbc);
vbc->add_margin_child(TTR("Source CSV:"),csvb);
import_path = memnew( LineEdit );
import_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(import_path);
ignore_first = memnew( CheckButton );
ignore_first->set_text(TTR("Ignore First Row"));
csvb->add_child(ignore_first);
Button * import_choose = memnew( Button );
import_choose->set_text(" .. ");
hbc->add_child(import_choose);
import_choose->connect("pressed", this,"_browse");
VBoxContainer *tcomp = memnew( VBoxContainer);
hbc = memnew( HBoxContainer );
tcomp->add_child(hbc);
vbc->add_margin_child(TTR("Target Path:"),tcomp);
save_path = memnew( LineEdit );
save_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(save_path);
Button * save_choose = memnew( Button );
save_choose->set_text(" .. ");
hbc->add_child(save_choose);
save_choose->connect("pressed", this,"_browse_target");
compress = memnew( CheckButton);
compress->set_pressed(true);
compress->set_text(TTR("Compress"));
tcomp->add_child(compress);
add_to_project = memnew( CheckButton);
add_to_project->set_pressed(true);
add_to_project->set_text(TTR("Add to Project (engine.cfg)"));
tcomp->add_child(add_to_project);
file_select = memnew(EditorFileDialog);
file_select->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
add_child(file_select);
file_select->set_mode(EditorFileDialog::MODE_OPEN_FILE);
file_select->connect("file_selected", this,"_choose_file");
file_select->add_filter("*.csv ; Translation CSV");
save_select = memnew( EditorDirDialog );
add_child(save_select);
// save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
get_ok()->set_text(TTR("Import"));
error_dialog = memnew ( ConfirmationDialog );
add_child(error_dialog);
error_dialog->get_ok()->set_text(TTR("Accept"));
// error_dialog->get_cancel()->hide();
set_hide_on_ok(false);
columns = memnew( Tree );
vbc->add_margin_child(TTR("Import Languages:"),columns,true);
}
开发者ID:jmintb,项目名称:godot,代码行数:83,代码来源:editor_translation_import_plugin.cpp
示例20: set_title
EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSceneImportPlugin *p_plugin) {
editor=p_editor;
plugin=p_plugin;
set_title("Import 3D Scene");
HBoxContainer *import_hb = memnew( HBoxContainer );
add_child(import_hb);
set_child_rect(import_hb);
VBoxContainer *vbc = memnew( VBoxContainer );
import_hb->add_child(vbc);
vbc->set_h_size_flags(SIZE_EXPAND_FILL);
HBoxContainer *hbc = memnew( HBoxContainer );
vbc->add_margin_child("Source Scene:",hbc);
import_path = memnew( LineEdit );
import_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(import_path);
Button * import_choose = memnew( Button );
import_choose->set_text(" .. ");
hbc->add_child(import_choose);
import_choose->connect("pressed", this,"_browse");
hbc = memnew( HBoxContainer );
vbc->add_margin_child("Target Scene:",hbc);
save_path = memnew( LineEdit );
save_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(save_path);
Button * save_choose = memnew( Button );
save_choose->set_text(" .. ");
hbc->add_child(save_choose);
save_choose->connect("pressed", this,"_browse_target");
texture_action = memnew( OptionButton );
texture_action->add_item("Same as Target Scene");
texture_action->add_item("Shared");
texture_action->select(0);
vbc->add_margin_child("Target Texture Folder:",texture_action);
import_options = memnew( Tree );
vbc->set_v_size_flags(SIZE_EXPAND_FILL);
vbc->add_margin_child("Options:",import_options,true);
file_select = memnew(FileDialog);
file_select->set_access(FileDialog::ACCESS_FILESYSTEM);
add_child(file_select);
file_select->set_mode(FileDialog::MODE_OPEN_FILE);
file_select->connect("file_selected", this,"_choose_file");
save_select = memnew(EditorDirDialog);
add_child(save_select);
//save_select->set_mode(FileDialog::MODE_SAVE_FILE);
save_select->connect("dir_selected", this,"_choose_save_file");
get_ok()->connect("pressed", this,"_import");
get_ok()->set_text("Import");
TreeItem *root = import_options->create_item(NULL);
import_options->set_hide_root(true);
TreeItem *importopts = import_options->create_item(root);
importopts->set_text(0,"Import:");
const FlagInfo* fn=scene_flag_names;
while(fn->text) {
TreeItem *opt = import_options->create_item(importopts);
opt->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
opt->set_checked(0,true);
opt->set_editable(0,true);
opt->set_text(0,fn->text);
opt->set_metadata(0,fn->value);
scene_flags.push_back(opt);
fn++;
}
hbc = memnew( HBoxContainer );
vbc->add_margin_child("Post-Process Script:",hbc);
script_path = memnew( LineEdit );
script_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(script_path);
//.........这里部分代码省略.........
开发者ID:9cat,项目名称:godot,代码行数:101,代码来源:editor_scene_import_plugin.cpp
注:本文中的set_child_rect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论