本文整理汇总了C++中SpinBox::get_val方法的典型用法代码示例。如果您正苦于以下问题:C++ SpinBox::get_val方法的具体用法?C++ SpinBox::get_val怎么用?C++ SpinBox::get_val使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpinBox
的用法示例。
在下文中一共展示了SpinBox::get_val方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memnew
Ref<ResourceImportMetadata> get_rimd() {
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
List<PropertyInfo> pl;
options->_get_property_list(&pl);
for(List<PropertyInfo>::Element *E=pl.front();E;E=E->next()) {
Variant v;
String opt=E->get().name;
options->_get(opt,v);
if (opt=="color/image" || opt=="character_set/custom") {
v = EditorImportPlugin::validate_source_path(v);
}
imd->set_option(opt,v);
}
imd->add_source(EditorImportPlugin::validate_source_path(source->get_line_edit()->get_text()));
imd->set_option("font/size",font_size->get_val());
return imd;
}
示例2: _import
void EditorTextureImportDialog::_import() {
// ImportMonitorBlock imb;
Vector<String> files=import_path->get_text().split(",");
if (!files.size()) {
error_dialog->set_text("Please specify some files!");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_path=save_path->get_text();
if (save_path->get_text().strip_edges()=="") {
error_dialog->set_text("Target path is empty.");
error_dialog->popup_centered_minsize();
return;
}
if (!save_path->get_text().begins_with("res://")) {
error_dialog->set_text("Target path must be full resource path.");
error_dialog->popup_centered_minsize();
return;
}
if (!atlas && !large && !DirAccess::exists(save_path->get_text())) {
error_dialog->set_text("Target path must exist.");
error_dialog->popup_centered_minsize();
return;
}
if (atlas) { //atlas
if (files.size()==0) {
error_dialog->set_text("At least one file needed for Atlas.");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_file = dst_path;
//dst_file=dst_file.basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
//imd->set_editor();
for(int i=0;i<files.size();i++) {
imd->add_source(EditorImportPlugin::validate_source_path(files[i]));
}
imd->set_option("format",texture_options->get_format());
imd->set_option("flags",texture_options->get_flags());
imd->set_option("quality",texture_options->get_quality());
imd->set_option("atlas",true);
imd->set_option("atlas_size",int(size->get_val()));
imd->set_option("large",false);
imd->set_option("crop",crop_source->is_pressed());
Error err = plugin->import(dst_file,imd);
if (err) {
error_dialog->set_text("Error importing: "+dst_file.get_file());
error_dialog->popup_centered(Size2(200,100));
return;
}
} else if (large) { //atlas
if (files.size()!=1) {
error_dialog->set_text("Only one file is required for large texture");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_file = dst_path;
//dst_file=dst_file.basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
//imd->set_editor();
for(int i=0;i<files.size();i++) {
imd->add_source(EditorImportPlugin::validate_source_path(files[i]));
}
imd->set_option("format",texture_options->get_format());
imd->set_option("flags",texture_options->get_flags());
imd->set_option("quality",texture_options->get_quality());
imd->set_option("atlas",false);
imd->set_option("large",true);
imd->set_option("large_cell_size",int(size->get_val()));
imd->set_option("crop",crop_source->is_pressed());
Error err = plugin->import(dst_file,imd);
if (err) {
error_dialog->set_text("Error importing: "+dst_file.get_file());
error_dialog->popup_centered(Size2(200,100));
return;
}
} else {
//.........这里部分代码省略.........