예제 #1
0
파일: material.cpp 프로젝트: 3miu/godot
void FixedMaterial::_bind_methods() {


	ObjectTypeDB::bind_method(_MD("set_parameter","param","value"),&FixedMaterial::set_parameter);
	ObjectTypeDB::bind_method(_MD("get_parameter","param"),&FixedMaterial::get_parameter);

	ObjectTypeDB::bind_method(_MD("set_texture","param","texture:Texture"),&FixedMaterial::set_texture);
	ObjectTypeDB::bind_method(_MD("get_texture:Texture","param"),&FixedMaterial::get_texture);


	ObjectTypeDB::bind_method(_MD("set_texcoord_mode","param","mode"),&FixedMaterial::set_texcoord_mode);
	ObjectTypeDB::bind_method(_MD("get_texcoord_mode","param"),&FixedMaterial::get_texcoord_mode);

	ObjectTypeDB::bind_method(_MD("set_fixed_flag","flag","value"),&FixedMaterial::set_fixed_flag);
	ObjectTypeDB::bind_method(_MD("get_fixed_flag","flag"),&FixedMaterial::get_fixed_flag);

	ObjectTypeDB::bind_method(_MD("set_uv_transform","transform"),&FixedMaterial::set_uv_transform);
	ObjectTypeDB::bind_method(_MD("get_uv_transform"),&FixedMaterial::get_uv_transform);

	ObjectTypeDB::bind_method(_MD("set_light_shader","shader"),&FixedMaterial::set_light_shader);
	ObjectTypeDB::bind_method(_MD("get_light_shader"),&FixedMaterial::get_light_shader);

	ObjectTypeDB::bind_method(_MD("set_point_size","size"),&FixedMaterial::set_point_size);
	ObjectTypeDB::bind_method(_MD("get_point_size"),&FixedMaterial::get_point_size);


	ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_alpha" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_ALPHA);
	ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_color_array" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_COLOR_ARRAY);
	ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_point_size" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_POINT_SIZE);
	ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/discard_alpha" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_DISCARD_ALPHA);
	ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_xy_normalmap" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_XY_NORMALMAP);
	ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/diffuse" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_DIFFUSE);
	ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/specular", PROPERTY_HINT_COLOR_NO_ALPHA ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPECULAR );
	ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/emission", PROPERTY_HINT_COLOR_NO_ALPHA ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_EMISSION );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/specular_exp", PROPERTY_HINT_RANGE,"1,64,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPECULAR_EXP );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/detail_mix", PROPERTY_HINT_RANGE,"0,1,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_DETAIL );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/normal_depth", PROPERTY_HINT_RANGE,"-4,4,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_NORMAL );
	ADD_PROPERTY( PropertyInfo( Variant::INT, "params/shader", PROPERTY_HINT_ENUM,"Lambert,Wrap,Velvet,Toon" ), _SCS("set_light_shader"), _SCS("get_light_shader") );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/shader_param", PROPERTY_HINT_RANGE,"0,1,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SHADE_PARAM );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/glow", PROPERTY_HINT_RANGE,"0,8,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_GLOW );
	ADD_PROPERTY( PropertyInfo( Variant::REAL, "params/point_size", PROPERTY_HINT_RANGE,"0,1024,1" ), _SCS("set_point_size"), _SCS("get_point_size"));
	ADD_PROPERTY( PropertyInfo( Variant::TRANSFORM, "uv_xform"), _SCS("set_uv_transform"), _SCS("get_uv_transform") );

	for(int i=0;i<PARAM_MAX;i++) {
		ADD_PROPERTYI( PropertyInfo( Variant::OBJECT, String()+"textures/"+_param_names[i],PROPERTY_HINT_RESOURCE_TYPE,"Texture" ), _SCS("set_texture"), _SCS("get_texture"), _param_indices[i]);
		ADD_PROPERTYI( PropertyInfo( Variant::INT, String()+"textures/"+_param_names[i]+"_tc",PROPERTY_HINT_ENUM,"UV,UV Xform,UV2,Sphere" ), _SCS("set_texcoord_mode"), _SCS("get_texcoord_mode"), _param_indices[i] );
	}


	BIND_CONSTANT( PARAM_DIFFUSE );
	BIND_CONSTANT( PARAM_DETAIL );
	BIND_CONSTANT( PARAM_SPECULAR );
	BIND_CONSTANT( PARAM_EMISSION );
	BIND_CONSTANT( PARAM_SPECULAR_EXP );
	BIND_CONSTANT( PARAM_GLOW );
	BIND_CONSTANT( PARAM_NORMAL );
	BIND_CONSTANT( PARAM_SHADE_PARAM );
	BIND_CONSTANT( PARAM_MAX );


	BIND_CONSTANT( TEXCOORD_SPHERE );
	BIND_CONSTANT( TEXCOORD_UV );
	BIND_CONSTANT( TEXCOORD_UV_TRANSFORM );
	BIND_CONSTANT( TEXCOORD_UV2 );

	BIND_CONSTANT( FLAG_USE_ALPHA );
	BIND_CONSTANT( FLAG_USE_COLOR_ARRAY );
	BIND_CONSTANT( FLAG_USE_POINT_SIZE );
	BIND_CONSTANT( FLAG_DISCARD_ALPHA );

}
예제 #2
0
파일: camera_2d.cpp 프로젝트: allkhor/godot
void Camera2D::_bind_methods() {

	ObjectTypeDB::bind_method(_MD("set_offset", "offset"), &Camera2D::set_offset);
	ObjectTypeDB::bind_method(_MD("get_offset"), &Camera2D::get_offset);

	ObjectTypeDB::bind_method(_MD("set_anchor_mode", "anchor_mode"), &Camera2D::set_anchor_mode);
	ObjectTypeDB::bind_method(_MD("get_anchor_mode"), &Camera2D::get_anchor_mode);

	ObjectTypeDB::bind_method(_MD("set_rotating", "rotating"), &Camera2D::set_rotating);
	ObjectTypeDB::bind_method(_MD("is_rotating"), &Camera2D::is_rotating);

	ObjectTypeDB::bind_method(_MD("make_current"), &Camera2D::make_current);
	ObjectTypeDB::bind_method(_MD("clear_current"), &Camera2D::clear_current);
	ObjectTypeDB::bind_method(_MD("_make_current"), &Camera2D::_make_current);

	ObjectTypeDB::bind_method(_MD("_update_scroll"), &Camera2D::_update_scroll);

	ObjectTypeDB::bind_method(_MD("_set_current", "current"), &Camera2D::_set_current);
	ObjectTypeDB::bind_method(_MD("is_current"), &Camera2D::is_current);

	ObjectTypeDB::bind_method(_MD("set_limit", "margin", "limit"), &Camera2D::set_limit);
	ObjectTypeDB::bind_method(_MD("get_limit", "margin"), &Camera2D::get_limit);

	ObjectTypeDB::bind_method(_MD("set_v_drag_enabled", "enabled"), &Camera2D::set_v_drag_enabled);
	ObjectTypeDB::bind_method(_MD("is_v_drag_enabled"), &Camera2D::is_v_drag_enabled);

	ObjectTypeDB::bind_method(_MD("set_h_drag_enabled", "enabled"), &Camera2D::set_h_drag_enabled);
	ObjectTypeDB::bind_method(_MD("is_h_drag_enabled"), &Camera2D::is_h_drag_enabled);

	ObjectTypeDB::bind_method(_MD("set_v_offset", "ofs"), &Camera2D::set_v_offset);
	ObjectTypeDB::bind_method(_MD("get_v_offset"), &Camera2D::get_v_offset);

	ObjectTypeDB::bind_method(_MD("set_h_offset", "ofs"), &Camera2D::set_h_offset);
	ObjectTypeDB::bind_method(_MD("get_h_offset"), &Camera2D::get_h_offset);

	ObjectTypeDB::bind_method(_MD("set_drag_margin", "margin", "drag_margin"), &Camera2D::set_drag_margin);
	ObjectTypeDB::bind_method(_MD("get_drag_margin", "margin"), &Camera2D::get_drag_margin);

	ObjectTypeDB::bind_method(_MD("get_camera_pos"), &Camera2D::get_camera_pos);
	ObjectTypeDB::bind_method(_MD("get_camera_screen_center"), &Camera2D::get_camera_screen_center);

	ObjectTypeDB::bind_method(_MD("set_zoom", "zoom"), &Camera2D::set_zoom);
	ObjectTypeDB::bind_method(_MD("get_zoom"), &Camera2D::get_zoom);

	ObjectTypeDB::bind_method(_MD("set_custom_viewport", "viewport:Viewport"), &Camera2D::set_custom_viewport);
	ObjectTypeDB::bind_method(_MD("get_custom_viewport:Viewport"), &Camera2D::get_custom_viewport);

	ObjectTypeDB::bind_method(_MD("set_follow_smoothing", "follow_smoothing"), &Camera2D::set_follow_smoothing);
	ObjectTypeDB::bind_method(_MD("get_follow_smoothing"), &Camera2D::get_follow_smoothing);

	ObjectTypeDB::bind_method(_MD("set_enable_follow_smoothing", "follow_smoothing"), &Camera2D::set_enable_follow_smoothing);
	ObjectTypeDB::bind_method(_MD("is_follow_smoothing_enabled"), &Camera2D::is_follow_smoothing_enabled);

	ObjectTypeDB::bind_method(_MD("force_update_scroll"), &Camera2D::force_update_scroll);
	ObjectTypeDB::bind_method(_MD("reset_smoothing"), &Camera2D::reset_smoothing);
	ObjectTypeDB::bind_method(_MD("align"), &Camera2D::align);

	ObjectTypeDB::bind_method(_MD("_set_old_smoothing", "follow_smoothing"), &Camera2D::_set_old_smoothing);

	ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "offset"), _SCS("set_offset"), _SCS("get_offset"));
	ADD_PROPERTY(PropertyInfo(Variant::INT, "anchor_mode", PROPERTY_HINT_ENUM, "Fixed TopLeft,Drag Center"), _SCS("set_anchor_mode"), _SCS("get_anchor_mode"));
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotating"), _SCS("set_rotating"), _SCS("is_rotating"));
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "current"), _SCS("_set_current"), _SCS("is_current"));
	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "zoom"), _SCS("set_zoom"), _SCS("get_zoom"));

	ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit/left"), _SCS("set_limit"), _SCS("get_limit"), MARGIN_LEFT);
	ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit/top"), _SCS("set_limit"), _SCS("get_limit"), MARGIN_TOP);
	ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit/right"), _SCS("set_limit"), _SCS("get_limit"), MARGIN_RIGHT);
	ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit/bottom"), _SCS("set_limit"), _SCS("get_limit"), MARGIN_BOTTOM);

	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "drag_margin/h_enabled"), _SCS("set_h_drag_enabled"), _SCS("is_h_drag_enabled"));
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "drag_margin/v_enabled"), _SCS("set_v_drag_enabled"), _SCS("is_v_drag_enabled"));

	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smoothing/enable"), _SCS("set_enable_follow_smoothing"), _SCS("is_follow_smoothing_enabled"));
	ADD_PROPERTY(PropertyInfo(Variant::REAL, "smoothing/speed"), _SCS("set_follow_smoothing"), _SCS("get_follow_smoothing"));

	//compatibility
	ADD_PROPERTY(PropertyInfo(Variant::REAL, "smoothing", PROPERTY_HINT_NONE, "", 0), _SCS("_set_old_smoothing"), _SCS("get_follow_smoothing"));

	ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin/left", PROPERTY_HINT_RANGE, "0,1,0.01"), _SCS("set_drag_margin"), _SCS("get_drag_margin"), MARGIN_LEFT);
	ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin/top", PROPERTY_HINT_RANGE, "0,1,0.01"), _SCS("set_drag_margin"), _SCS("get_drag_margin"), MARGIN_TOP);
	ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin/right", PROPERTY_HINT_RANGE, "0,1,0.01"), _SCS("set_drag_margin"), _SCS("get_drag_margin"), MARGIN_RIGHT);
	ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin/bottom", PROPERTY_HINT_RANGE, "0,1,0.01"), _SCS("set_drag_margin"), _SCS("get_drag_margin"), MARGIN_BOTTOM);

	BIND_CONSTANT(ANCHOR_MODE_DRAG_CENTER);
	BIND_CONSTANT(ANCHOR_MODE_FIXED_TOP_LEFT);
}
예제 #3
0
void Particles2D::_bind_methods() {

	ClassDB::bind_method(_MD("set_emitting","active"),&Particles2D::set_emitting);
	ClassDB::bind_method(_MD("is_emitting"),&Particles2D::is_emitting);

	ClassDB::bind_method(_MD("set_amount","amount"),&Particles2D::set_amount);
	ClassDB::bind_method(_MD("get_amount"),&Particles2D::get_amount);

	ClassDB::bind_method(_MD("set_lifetime","lifetime"),&Particles2D::set_lifetime);
	ClassDB::bind_method(_MD("get_lifetime"),&Particles2D::get_lifetime);

	ClassDB::bind_method(_MD("set_time_scale","time_scale"),&Particles2D::set_time_scale);
	ClassDB::bind_method(_MD("get_time_scale"),&Particles2D::get_time_scale);

	ClassDB::bind_method(_MD("set_pre_process_time","time"),&Particles2D::set_pre_process_time);
	ClassDB::bind_method(_MD("get_pre_process_time"),&Particles2D::get_pre_process_time);

	ClassDB::bind_method(_MD("set_emit_timeout","value"),&Particles2D::set_emit_timeout);
	ClassDB::bind_method(_MD("get_emit_timeout"),&Particles2D::get_emit_timeout);

	ClassDB::bind_method(_MD("set_param","param","value"),&Particles2D::set_param);
	ClassDB::bind_method(_MD("get_param","param"),&Particles2D::get_param);

	ClassDB::bind_method(_MD("set_randomness","param","value"),&Particles2D::set_randomness);
	ClassDB::bind_method(_MD("get_randomness","param"),&Particles2D::get_randomness);

	ClassDB::bind_method(_MD("set_texture:Texture","texture"),&Particles2D::set_texture);
	ClassDB::bind_method(_MD("get_texture:Texture"),&Particles2D::get_texture);

	ClassDB::bind_method(_MD("set_color","color"),&Particles2D::set_color);
	ClassDB::bind_method(_MD("get_color"),&Particles2D::get_color);

	ClassDB::bind_method(_MD("set_color_ramp:ColorRamp","color_ramp"),&Particles2D::set_color_ramp);
	ClassDB::bind_method(_MD("get_color_ramp:ColorRamp"),&Particles2D::get_color_ramp);

	ClassDB::bind_method(_MD("set_emissor_offset","offset"),&Particles2D::set_emissor_offset);
	ClassDB::bind_method(_MD("get_emissor_offset"),&Particles2D::get_emissor_offset);

	ClassDB::bind_method(_MD("set_flip_h","enable"),&Particles2D::set_flip_h);
	ClassDB::bind_method(_MD("is_flipped_h"),&Particles2D::is_flipped_h);

	ClassDB::bind_method(_MD("set_flip_v","enable"),&Particles2D::set_flip_v);
	ClassDB::bind_method(_MD("is_flipped_v"),&Particles2D::is_flipped_v);

	ClassDB::bind_method(_MD("set_h_frames","enable"),&Particles2D::set_h_frames);
	ClassDB::bind_method(_MD("get_h_frames"),&Particles2D::get_h_frames);

	ClassDB::bind_method(_MD("set_v_frames","enable"),&Particles2D::set_v_frames);
	ClassDB::bind_method(_MD("get_v_frames"),&Particles2D::get_v_frames);

	ClassDB::bind_method(_MD("set_emission_half_extents","extents"),&Particles2D::set_emission_half_extents);
	ClassDB::bind_method(_MD("get_emission_half_extents"),&Particles2D::get_emission_half_extents);

	ClassDB::bind_method(_MD("set_color_phases","phases"),&Particles2D::set_color_phases);
	ClassDB::bind_method(_MD("get_color_phases"),&Particles2D::get_color_phases);

	ClassDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles2D::set_color_phase_color);
	ClassDB::bind_method(_MD("get_color_phase_color","phase"),&Particles2D::get_color_phase_color);

	ClassDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles2D::set_color_phase_pos);
	ClassDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles2D::get_color_phase_pos);

	ClassDB::bind_method(_MD("pre_process","time"),&Particles2D::pre_process);
	ClassDB::bind_method(_MD("reset"),&Particles2D::reset);

	ClassDB::bind_method(_MD("set_use_local_space","enable"),&Particles2D::set_use_local_space);
	ClassDB::bind_method(_MD("is_using_local_space"),&Particles2D::is_using_local_space);

	ClassDB::bind_method(_MD("set_initial_velocity","velocity"),&Particles2D::set_initial_velocity);
	ClassDB::bind_method(_MD("get_initial_velocity"),&Particles2D::get_initial_velocity);

	ClassDB::bind_method(_MD("set_explosiveness","amount"),&Particles2D::set_explosiveness);
	ClassDB::bind_method(_MD("get_explosiveness"),&Particles2D::get_explosiveness);

	ClassDB::bind_method(_MD("set_emission_points","points"),&Particles2D::set_emission_points);
	ClassDB::bind_method(_MD("get_emission_points"),&Particles2D::get_emission_points);

	ADD_PROPERTY(PropertyInfo(Variant::INT,"config/amount",PROPERTY_HINT_EXP_RANGE,"1,1024"),_SCS("set_amount"),_SCS("get_amount") );
	ADD_PROPERTY(PropertyInfo(Variant::REAL,"config/lifetime",PROPERTY_HINT_EXP_RANGE,"0.1,3600,0.1"),_SCS("set_lifetime"),_SCS("get_lifetime") );
	ADD_PROPERTYNO(PropertyInfo(Variant::REAL,"config/time_scale",PROPERTY_HINT_EXP_RANGE,"0.01,128,0.01"),_SCS("set_time_scale"),_SCS("get_time_scale") );
	ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"config/preprocess",PROPERTY_HINT_EXP_RANGE,"0.1,3600,0.1"),_SCS("set_pre_process_time"),_SCS("get_pre_process_time") );
	ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"config/emit_timeout",PROPERTY_HINT_RANGE,"0,3600,0.1"),_SCS("set_emit_timeout"),_SCS("get_emit_timeout") );
	ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"config/emitting"),_SCS("set_emitting"),_SCS("is_emitting") );
	ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"config/offset"),_SCS("set_emissor_offset"),_SCS("get_emissor_offset"));
	ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"config/half_extents"),_SCS("set_emission_half_extents"),_SCS("get_emission_half_extents"));
	ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"config/local_space"),_SCS("set_use_local_space"),_SCS("is_using_local_space"));
	ADD_PROPERTYNO(PropertyInfo(Variant::REAL,"config/explosiveness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_explosiveness"),_SCS("get_explosiveness"));
	ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL,"config/flip_h"),_SCS("set_flip_h"),_SCS("is_flipped_h"));
	ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL,"config/flip_v"),_SCS("set_flip_v"),_SCS("is_flipped_v"));
	ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"config/texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"));
	ADD_PROPERTYNO(PropertyInfo(Variant::INT,"config/h_frames",PROPERTY_HINT_RANGE,"1,512,1"),_SCS("set_h_frames"),_SCS("get_h_frames"));
	ADD_PROPERTYNO(PropertyInfo(Variant::INT,"config/v_frames",PROPERTY_HINT_RANGE,"1,512,1"),_SCS("set_v_frames"),_SCS("get_v_frames"));


	for(int i=0;i<PARAM_MAX;i++) {
		ADD_PROPERTYI(PropertyInfo(Variant::REAL,_particlesframe_property_names[i],PROPERTY_HINT_RANGE,_particlesframe_property_ranges[i]),_SCS("set_param"),_SCS("get_param"),i);
	}

	for(int i=0;i<PARAM_MAX;i++) {
		ADD_PROPERTYINZ(PropertyInfo(Variant::REAL,_particlesframe_property_rnames[i],PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_randomness"),_SCS("get_randomness"),i);
	}

	ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "color_phases/count",PROPERTY_HINT_RANGE,"0,4,1", 0), _SCS("set_color_phases"), _SCS("get_color_phases"));

	//Backward compatibility. They will be converted to color ramp
	for(int i=0;i<MAX_COLOR_PHASES;i++) {
		String phase="phase_"+itos(i)+"/";
		ADD_PROPERTYI( PropertyInfo( Variant::REAL, phase+"pos", PROPERTY_HINT_RANGE,"0,1,0.01", 0),_SCS("set_color_phase_pos"),_SCS("get_color_phase_pos"),i );
		ADD_PROPERTYI( PropertyInfo( Variant::COLOR, phase+"color", PROPERTY_HINT_NONE, "", 0),_SCS("set_color_phase_color"),_SCS("get_color_phase_color"),i );
	}

	ADD_PROPERTYNO(PropertyInfo(Variant::COLOR, "color/color"),_SCS("set_color"),_SCS("get_color"));
	ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"color/color_ramp",PROPERTY_HINT_RESOURCE_TYPE,"ColorRamp"),_SCS("set_color_ramp"),_SCS("get_color_ramp"));

	ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2_ARRAY,"emission_points",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_emission_points"),_SCS("get_emission_points"));

	BIND_CONSTANT( PARAM_DIRECTION );
	BIND_CONSTANT( PARAM_SPREAD );
	BIND_CONSTANT( PARAM_LINEAR_VELOCITY );
	BIND_CONSTANT( PARAM_SPIN_VELOCITY );
	BIND_CONSTANT( PARAM_ORBIT_VELOCITY );
	BIND_CONSTANT( PARAM_GRAVITY_DIRECTION );
	BIND_CONSTANT( PARAM_GRAVITY_STRENGTH );
	BIND_CONSTANT( PARAM_RADIAL_ACCEL );
	BIND_CONSTANT( PARAM_TANGENTIAL_ACCEL );
	BIND_CONSTANT( PARAM_DAMPING );
	BIND_CONSTANT( PARAM_INITIAL_ANGLE );
	BIND_CONSTANT( PARAM_INITIAL_SIZE );
	BIND_CONSTANT( PARAM_FINAL_SIZE );
	BIND_CONSTANT( PARAM_HUE_VARIATION );
	BIND_CONSTANT( PARAM_ANIM_SPEED_SCALE );
	BIND_CONSTANT( PARAM_ANIM_INITIAL_POS );
	BIND_CONSTANT( PARAM_MAX );

	BIND_CONSTANT( MAX_COLOR_PHASES );

}
예제 #4
0
파일: particles.cpp 프로젝트: 3miu/godot
void Particles::_bind_methods() {

	ObjectTypeDB::bind_method(_MD("set_amount","amount"),&Particles::set_amount);
	ObjectTypeDB::bind_method(_MD("get_amount"),&Particles::get_amount);
	ObjectTypeDB::bind_method(_MD("set_emitting","enabled"),&Particles::set_emitting);
	ObjectTypeDB::bind_method(_MD("is_emitting"),&Particles::is_emitting);
	ObjectTypeDB::bind_method(_MD("set_visibility_aabb","aabb"),&Particles::set_visibility_aabb);
	ObjectTypeDB::bind_method(_MD("get_visibility_aabb"),&Particles::get_visibility_aabb);
	ObjectTypeDB::bind_method(_MD("set_emission_half_extents","half_extents"),&Particles::set_emission_half_extents);
	ObjectTypeDB::bind_method(_MD("get_emission_half_extents"),&Particles::get_emission_half_extents);
	ObjectTypeDB::bind_method(_MD("set_emission_base_velocity","base_velocity"),&Particles::set_emission_base_velocity);
	ObjectTypeDB::bind_method(_MD("get_emission_base_velocity"),&Particles::get_emission_base_velocity);
	ObjectTypeDB::bind_method(_MD("set_emission_points","points"),&Particles::set_emission_points);
	ObjectTypeDB::bind_method(_MD("get_emission_points"),&Particles::get_emission_points);
	ObjectTypeDB::bind_method(_MD("set_gravity_normal","normal"),&Particles::set_gravity_normal);
	ObjectTypeDB::bind_method(_MD("get_gravity_normal"),&Particles::get_gravity_normal);
	ObjectTypeDB::bind_method(_MD("set_variable","variable","value"),&Particles::set_variable);
	ObjectTypeDB::bind_method(_MD("get_variable","variable"),&Particles::get_variable);
	ObjectTypeDB::bind_method(_MD("set_randomness","variable","randomness"),&Particles::set_randomness);
	ObjectTypeDB::bind_method(_MD("get_randomness"),&Particles::get_randomness);
	ObjectTypeDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles::set_color_phase_pos);
	ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles::get_color_phase_pos);
	ObjectTypeDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles::set_color_phase_color);
	ObjectTypeDB::bind_method(_MD("get_color_phase_color","phase"),&Particles::get_color_phase_color);
	ObjectTypeDB::bind_method(_MD("set_material","material:Material"),&Particles::set_material);
	ObjectTypeDB::bind_method(_MD("get_material:Material"),&Particles::get_material);
	ObjectTypeDB::bind_method(_MD("set_emit_timeout"),&Particles::set_emit_timeout);
	ObjectTypeDB::bind_method(_MD("get_emit_timeout"),&Particles::get_emit_timeout);
	ObjectTypeDB::bind_method(_MD("set_height_from_velocity","enable"),&Particles::set_height_from_velocity);
	ObjectTypeDB::bind_method(_MD("has_height_from_velocity"),&Particles::has_height_from_velocity);
	ObjectTypeDB::bind_method(_MD("set_use_local_coordinates","enable"),&Particles::set_use_local_coordinates);
	ObjectTypeDB::bind_method(_MD("is_using_local_coordinates"),&Particles::is_using_local_coordinates);

	ObjectTypeDB::bind_method(_MD("set_color_phases","count"),&Particles::set_color_phases);
	ObjectTypeDB::bind_method(_MD("get_color_phases"),&Particles::get_color_phases);

	ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material" ), _SCS("set_material"), _SCS("get_material") );

	ADD_PROPERTY( PropertyInfo( Variant::INT, "amount", PROPERTY_HINT_RANGE, "1,4096,1" ), _SCS("set_amount"), _SCS("get_amount") );
	ADD_PROPERTY( PropertyInfo( Variant::BOOL, "emitting" ), _SCS("set_emitting"), _SCS("is_emitting") );
	ADD_PROPERTY( PropertyInfo( Variant::_AABB, "visibility" ), _SCS("set_visibility_aabb"), _SCS("get_visibility_aabb") );
	ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "emission_extents" ), _SCS("set_emission_half_extents"), _SCS("get_emission_half_extents") );
	ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "emission_base_velocity" ), _SCS("set_emission_base_velocity"), _SCS("get_emission_base_velocity") );
	ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "emission_points" ), _SCS("set_emission_points"), _SCS("get_emission_points") );
	ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "gravity_normal" ), _SCS("set_gravity_normal"), _SCS("get_gravity_normal") );
	ADD_PROPERTY( PropertyInfo( Variant::BOOL, "local_coords" ), _SCS("set_use_local_coordinates"), _SCS("is_using_local_coordinates") );
	ADD_PROPERTY( PropertyInfo( Variant::REAL, "emit_timeout",PROPERTY_HINT_RANGE,"0,256,0.01"), _SCS("set_emit_timeout"), _SCS("get_emit_timeout") );


	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/lifetime", PROPERTY_HINT_RANGE,"0.1,60,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_LIFETIME );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/spread", PROPERTY_HINT_RANGE,"0,1,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_SPREAD );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/gravity", PROPERTY_HINT_RANGE,"-48,48,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_GRAVITY );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/linear_vel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_LINEAR_VELOCITY );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/angular_vel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_ANGULAR_VELOCITY );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/linear_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_LINEAR_ACCELERATION );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/radial_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_DRAG );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/tan_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_TANGENTIAL_ACCELERATION );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/damping", PROPERTY_HINT_RANGE,"0,128,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_DAMPING );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/initial_size", PROPERTY_HINT_RANGE,"0,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_INITIAL_SIZE );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/final_size", PROPERTY_HINT_RANGE,"0,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_FINAL_SIZE );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/initial_angle",PROPERTY_HINT_RANGE,"0,1,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_INITIAL_ANGLE );
	ADD_PROPERTY( PropertyInfo( Variant::BOOL, "vars/height_from_velocity"), _SCS("set_height_from_velocity"), _SCS("has_height_from_velocity") );
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/height",PROPERTY_HINT_RANGE,"0,4096,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_HEIGHT);
	ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/height_speed_scale",PROPERTY_HINT_RANGE,"0,4096,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_HEIGHT_SPEED_SCALE );

	for(int i=0;i<VAR_MAX;i++)
		ADD_PROPERTYI( PropertyInfo( Variant::REAL, _rand_names[i], PROPERTY_HINT_RANGE,"-16.0,16.0,0.01"),_SCS("set_randomness"), _SCS("get_randomness"),_var_indices[i] );


	ADD_PROPERTY( PropertyInfo( Variant::INT, "color_phases/count",PROPERTY_HINT_RANGE,"0,4,1"), _SCS("set_color_phases"), _SCS("get_color_phases"));

	for(int i=0;i<VS::MAX_PARTICLE_COLOR_PHASES;i++) {
		String phase="phase_"+itos(i)+"/";
		ADD_PROPERTYI( PropertyInfo( Variant::REAL, phase+"pos", PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_color_phase_pos"),_SCS("get_color_phase_pos"),i );
		ADD_PROPERTYI( PropertyInfo( Variant::COLOR, phase+"color"),_SCS("set_color_phase_color"),_SCS("get_color_phase_color"),i );
	}

	BIND_CONSTANT( VAR_LIFETIME );
	BIND_CONSTANT( VAR_SPREAD );
	BIND_CONSTANT( VAR_GRAVITY );
	BIND_CONSTANT( VAR_LINEAR_VELOCITY );
	BIND_CONSTANT( VAR_ANGULAR_VELOCITY );
	BIND_CONSTANT( VAR_LINEAR_ACCELERATION );
	BIND_CONSTANT( VAR_DRAG );
	BIND_CONSTANT( VAR_TANGENTIAL_ACCELERATION );
	BIND_CONSTANT( VAR_INITIAL_SIZE );
	BIND_CONSTANT( VAR_FINAL_SIZE );
	BIND_CONSTANT( VAR_INITIAL_ANGLE );
	BIND_CONSTANT( VAR_HEIGHT );
	BIND_CONSTANT( VAR_HEIGHT_SPEED_SCALE );
	BIND_CONSTANT( VAR_MAX );

}
예제 #5
0
파일: light.cpp 프로젝트: JoeSwangion/godot
void OmniLight::_bind_methods() {

    ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/radius", PROPERTY_HINT_EXP_RANGE, "0.2,4096,0.01"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_RADIUS );
    ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_ATTENUATION );

}
예제 #6
0
void BakedLight::_bind_methods(){


	ObjectTypeDB::bind_method(_MD("set_mode","mode"),&BakedLight::set_mode);
	ObjectTypeDB::bind_method(_MD("get_mode"),&BakedLight::get_mode);

	ObjectTypeDB::bind_method(_MD("set_octree","octree"),&BakedLight::set_octree);
	ObjectTypeDB::bind_method(_MD("get_octree"),&BakedLight::get_octree);

	ObjectTypeDB::bind_method(_MD("set_light","light"),&BakedLight::set_light);
	ObjectTypeDB::bind_method(_MD("get_light"),&BakedLight::get_light);

	ObjectTypeDB::bind_method(_MD("set_sampler_octree","sampler_octree"),&BakedLight::set_sampler_octree);
	ObjectTypeDB::bind_method(_MD("get_sampler_octree"),&BakedLight::get_sampler_octree);


	ObjectTypeDB::bind_method(_MD("add_lightmap","texture:Texture","gen_size"),&BakedLight::add_lightmap);
	ObjectTypeDB::bind_method(_MD("erase_lightmap","id"),&BakedLight::erase_lightmap);
	ObjectTypeDB::bind_method(_MD("clear_lightmaps"),&BakedLight::clear_lightmaps);

	ObjectTypeDB::bind_method(_MD("_set_lightmap_data","lightmap_data"),&BakedLight::_set_lightmap_data);
	ObjectTypeDB::bind_method(_MD("_get_lightmap_data"),&BakedLight::_get_lightmap_data);

	ObjectTypeDB::bind_method(_MD("set_cell_subdivision","cell_subdivision"),&BakedLight::set_cell_subdivision);
	ObjectTypeDB::bind_method(_MD("get_cell_subdivision"),&BakedLight::get_cell_subdivision);

	ObjectTypeDB::bind_method(_MD("set_initial_lattice_subdiv","cell_subdivision"),&BakedLight::set_initial_lattice_subdiv);
	ObjectTypeDB::bind_method(_MD("get_initial_lattice_subdiv","cell_subdivision"),&BakedLight::get_initial_lattice_subdiv);

	ObjectTypeDB::bind_method(_MD("set_plot_size","plot_size"),&BakedLight::set_plot_size);
	ObjectTypeDB::bind_method(_MD("get_plot_size"),&BakedLight::get_plot_size);

	ObjectTypeDB::bind_method(_MD("set_bounces","bounces"),&BakedLight::set_bounces);
	ObjectTypeDB::bind_method(_MD("get_bounces"),&BakedLight::get_bounces);

	ObjectTypeDB::bind_method(_MD("set_cell_extra_margin","cell_extra_margin"),&BakedLight::set_cell_extra_margin);
	ObjectTypeDB::bind_method(_MD("get_cell_extra_margin"),&BakedLight::get_cell_extra_margin);

	ObjectTypeDB::bind_method(_MD("set_edge_damp","edge_damp"),&BakedLight::set_edge_damp);
	ObjectTypeDB::bind_method(_MD("get_edge_damp"),&BakedLight::get_edge_damp);

	ObjectTypeDB::bind_method(_MD("set_normal_damp","normal_damp"),&BakedLight::set_normal_damp);
	ObjectTypeDB::bind_method(_MD("get_normal_damp"),&BakedLight::get_normal_damp);

	ObjectTypeDB::bind_method(_MD("set_tint","tint"),&BakedLight::set_tint);
	ObjectTypeDB::bind_method(_MD("get_tint"),&BakedLight::get_tint);

	ObjectTypeDB::bind_method(_MD("set_saturation","saturation"),&BakedLight::set_saturation);
	ObjectTypeDB::bind_method(_MD("get_saturation"),&BakedLight::get_saturation);

	ObjectTypeDB::bind_method(_MD("set_ao_radius","ao_radius"),&BakedLight::set_ao_radius);
	ObjectTypeDB::bind_method(_MD("get_ao_radius"),&BakedLight::get_ao_radius);

	ObjectTypeDB::bind_method(_MD("set_ao_strength","ao_strength"),&BakedLight::set_ao_strength);
	ObjectTypeDB::bind_method(_MD("get_ao_strength"),&BakedLight::get_ao_strength);

	ObjectTypeDB::bind_method(_MD("set_format","format"),&BakedLight::set_format);
	ObjectTypeDB::bind_method(_MD("get_format"),&BakedLight::get_format);

	ObjectTypeDB::bind_method(_MD("set_transfer_lightmaps_only_to_uv2","enable"),&BakedLight::set_transfer_lightmaps_only_to_uv2);
	ObjectTypeDB::bind_method(_MD("get_transfer_lightmaps_only_to_uv2"),&BakedLight::get_transfer_lightmaps_only_to_uv2);




	ObjectTypeDB::bind_method(_MD("set_energy_multiplier","energy_multiplier"),&BakedLight::set_energy_multiplier);
	ObjectTypeDB::bind_method(_MD("get_energy_multiplier"),&BakedLight::get_energy_multiplier);

	ObjectTypeDB::bind_method(_MD("set_gamma_adjust","gamma_adjust"),&BakedLight::set_gamma_adjust);
	ObjectTypeDB::bind_method(_MD("get_gamma_adjust"),&BakedLight::get_gamma_adjust);

	ObjectTypeDB::bind_method(_MD("set_bake_flag","flag","enabled"),&BakedLight::set_bake_flag);
	ObjectTypeDB::bind_method(_MD("get_bake_flag","flag"),&BakedLight::get_bake_flag);

	ADD_PROPERTY( PropertyInfo(Variant::INT,"mode/mode",PROPERTY_HINT_ENUM,"Octree,Lightmaps"),_SCS("set_mode"),_SCS("get_mode"));

	ADD_PROPERTY( PropertyInfo(Variant::INT,"baking/format",PROPERTY_HINT_ENUM,"RGB,HDR8,HDR16"),_SCS("set_format"),_SCS("get_format"));
	ADD_PROPERTY( PropertyInfo(Variant::INT,"baking/cell_subdiv",PROPERTY_HINT_RANGE,"4,14,1"),_SCS("set_cell_subdivision"),_SCS("get_cell_subdivision"));
	ADD_PROPERTY( PropertyInfo(Variant::INT,"baking/lattice_subdiv",PROPERTY_HINT_RANGE,"1,5,1"),_SCS("set_initial_lattice_subdiv"),_SCS("get_initial_lattice_subdiv"));
	ADD_PROPERTY( PropertyInfo(Variant::INT,"baking/light_bounces",PROPERTY_HINT_RANGE,"0,3,1"),_SCS("set_bounces"),_SCS("get_bounces"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"baking/plot_size",PROPERTY_HINT_RANGE,"1.0,16.0,0.01"),_SCS("set_plot_size"),_SCS("get_plot_size"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"baking/energy_mult",PROPERTY_HINT_RANGE,"0.01,4096.0,0.01"),_SCS("set_energy_multiplier"),_SCS("get_energy_multiplier"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"baking/gamma_adjust",PROPERTY_HINT_EXP_EASING),_SCS("set_gamma_adjust"),_SCS("get_gamma_adjust"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"baking/saturation",PROPERTY_HINT_RANGE,"0,8,0.01"),_SCS("set_saturation"),_SCS("get_saturation"));
	ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/diffuse"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_DIFFUSE);
	ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/specular"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_SPECULAR);
	ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/translucent"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_TRANSLUCENT);
	ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/conserve_energy"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_CONSERVE_ENERGY);
	ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/linear_color"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_LINEAR_COLOR);
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"lightmap/use_only_uv2"),_SCS("set_transfer_lightmaps_only_to_uv2"),_SCS("get_transfer_lightmaps_only_to_uv2"));

	ADD_PROPERTY( PropertyInfo(Variant::RAW_ARRAY,"octree",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_octree"),_SCS("get_octree"));
	ADD_PROPERTY( PropertyInfo(Variant::RAW_ARRAY,"light",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_light"),_SCS("get_light"));
	ADD_PROPERTY( PropertyInfo(Variant::INT_ARRAY,"sampler_octree",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_sampler_octree"),_SCS("get_sampler_octree"));
	ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"lightmaps",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_lightmap_data"),_SCS("_get_lightmap_data"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/cell_margin",PROPERTY_HINT_RANGE,"0.01,0.8,0.01"),_SCS("set_cell_extra_margin"),_SCS("get_cell_extra_margin"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/edge_damp",PROPERTY_HINT_RANGE,"0.0,8.0,0.1"),_SCS("set_edge_damp"),_SCS("get_edge_damp"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/normal_damp",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_normal_damp"),_SCS("get_normal_damp"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/light_tint",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_tint"),_SCS("get_tint"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/ao_radius",PROPERTY_HINT_RANGE,"0.0,16.0,0.01"),_SCS("set_ao_radius"),_SCS("get_ao_radius"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/ao_strength",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_ao_strength"),_SCS("get_ao_strength"));

	BIND_CONSTANT(  MODE_OCTREE );
	BIND_CONSTANT(  MODE_LIGHTMAPS );

	BIND_CONSTANT(  BAKE_DIFFUSE );
	BIND_CONSTANT(  BAKE_SPECULAR );
	BIND_CONSTANT(  BAKE_TRANSLUCENT );
	BIND_CONSTANT(  BAKE_CONSERVE_ENERGY );
	BIND_CONSTANT(  BAKE_MAX );


}
예제 #7
0
파일: sprite_3d.cpp 프로젝트: 93i/godot
void SpriteBase3D::_bind_methods() {

	ClassDB::bind_method(D_METHOD("set_centered", "centered"), &SpriteBase3D::set_centered);
	ClassDB::bind_method(D_METHOD("is_centered"), &SpriteBase3D::is_centered);

	ClassDB::bind_method(D_METHOD("set_offset", "offset"), &SpriteBase3D::set_offset);
	ClassDB::bind_method(D_METHOD("get_offset"), &SpriteBase3D::get_offset);

	ClassDB::bind_method(D_METHOD("set_flip_h", "flip_h"), &SpriteBase3D::set_flip_h);
	ClassDB::bind_method(D_METHOD("is_flipped_h"), &SpriteBase3D::is_flipped_h);

	ClassDB::bind_method(D_METHOD("set_flip_v", "flip_v"), &SpriteBase3D::set_flip_v);
	ClassDB::bind_method(D_METHOD("is_flipped_v"), &SpriteBase3D::is_flipped_v);

	ClassDB::bind_method(D_METHOD("set_modulate", "modulate"), &SpriteBase3D::set_modulate);
	ClassDB::bind_method(D_METHOD("get_modulate"), &SpriteBase3D::get_modulate);

	ClassDB::bind_method(D_METHOD("set_opacity", "opacity"), &SpriteBase3D::set_opacity);
	ClassDB::bind_method(D_METHOD("get_opacity"), &SpriteBase3D::get_opacity);

	ClassDB::bind_method(D_METHOD("set_pixel_size", "pixel_size"), &SpriteBase3D::set_pixel_size);
	ClassDB::bind_method(D_METHOD("get_pixel_size"), &SpriteBase3D::get_pixel_size);

	ClassDB::bind_method(D_METHOD("set_axis", "axis"), &SpriteBase3D::set_axis);
	ClassDB::bind_method(D_METHOD("get_axis"), &SpriteBase3D::get_axis);

	ClassDB::bind_method(D_METHOD("set_draw_flag", "flag", "enabled"), &SpriteBase3D::set_draw_flag);
	ClassDB::bind_method(D_METHOD("get_draw_flag", "flag"), &SpriteBase3D::get_draw_flag);

	ClassDB::bind_method(D_METHOD("set_alpha_cut_mode", "mode"), &SpriteBase3D::set_alpha_cut_mode);
	ClassDB::bind_method(D_METHOD("get_alpha_cut_mode"), &SpriteBase3D::get_alpha_cut_mode);

	ClassDB::bind_method(D_METHOD("get_item_rect"), &SpriteBase3D::get_item_rect);
	ClassDB::bind_method(D_METHOD("generate_triangle_mesh"), &SpriteBase3D::generate_triangle_mesh);

	ClassDB::bind_method(D_METHOD("_queue_update"), &SpriteBase3D::_queue_update);
	ClassDB::bind_method(D_METHOD("_im_update"), &SpriteBase3D::_im_update);

	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_h"), "set_flip_h", "is_flipped_h");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_v"), "set_flip_v", "is_flipped_v");
	ADD_PROPERTY(PropertyInfo(Variant::COLOR, "modulate"), "set_modulate", "get_modulate");
	ADD_PROPERTY(PropertyInfo(Variant::REAL, "opacity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_opacity", "get_opacity");
	ADD_PROPERTY(PropertyInfo(Variant::REAL, "pixel_size", PROPERTY_HINT_RANGE, "0.0001,128,0.0001"), "set_pixel_size", "get_pixel_size");
	ADD_PROPERTY(PropertyInfo(Variant::INT, "axis", PROPERTY_HINT_ENUM, "X-Axis,Y-Axis,Z-Axis"), "set_axis", "get_axis");
	ADD_GROUP("Flags", "");
	ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "transparent"), "set_draw_flag", "get_draw_flag", FLAG_TRANSPARENT);
	ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "shaded"), "set_draw_flag", "get_draw_flag", FLAG_SHADED);
	ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "double_sided"), "set_draw_flag", "get_draw_flag", FLAG_DOUBLE_SIDED);
	ADD_PROPERTY(PropertyInfo(Variant::INT, "alpha_cut", PROPERTY_HINT_ENUM, "Disabled,Discard,Opaque Pre-Pass"), "set_alpha_cut_mode", "get_alpha_cut_mode");

	BIND_ENUM_CONSTANT(FLAG_TRANSPARENT);
	BIND_ENUM_CONSTANT(FLAG_SHADED);
	BIND_ENUM_CONSTANT(FLAG_DOUBLE_SIDED);
	BIND_ENUM_CONSTANT(FLAG_MAX);

	BIND_ENUM_CONSTANT(ALPHA_CUT_DISABLED);
	BIND_ENUM_CONSTANT(ALPHA_CUT_DISCARD);
	BIND_ENUM_CONSTANT(ALPHA_CUT_OPAQUE_PREPASS);
}
예제 #8
0
void Camera2D::_bind_methods() {

	ClassDB::bind_method(D_METHOD("set_offset", "offset"), &Camera2D::set_offset);
	ClassDB::bind_method(D_METHOD("get_offset"), &Camera2D::get_offset);

	ClassDB::bind_method(D_METHOD("set_anchor_mode", "anchor_mode"), &Camera2D::set_anchor_mode);
	ClassDB::bind_method(D_METHOD("get_anchor_mode"), &Camera2D::get_anchor_mode);

	ClassDB::bind_method(D_METHOD("set_rotating", "rotating"), &Camera2D::set_rotating);
	ClassDB::bind_method(D_METHOD("is_rotating"), &Camera2D::is_rotating);

	ClassDB::bind_method(D_METHOD("make_current"), &Camera2D::make_current);
	ClassDB::bind_method(D_METHOD("clear_current"), &Camera2D::clear_current);
	ClassDB::bind_method(D_METHOD("_make_current"), &Camera2D::_make_current);

	ClassDB::bind_method(D_METHOD("_update_scroll"), &Camera2D::_update_scroll);

	ClassDB::bind_method(D_METHOD("_set_current", "current"), &Camera2D::_set_current);
	ClassDB::bind_method(D_METHOD("is_current"), &Camera2D::is_current);

	ClassDB::bind_method(D_METHOD("set_limit", "margin", "limit"), &Camera2D::set_limit);
	ClassDB::bind_method(D_METHOD("get_limit", "margin"), &Camera2D::get_limit);

	ClassDB::bind_method(D_METHOD("set_limit_smoothing_enabled", "limit_smoothing_enabled"), &Camera2D::set_limit_smoothing_enabled);
	ClassDB::bind_method(D_METHOD("is_limit_smoothing_enabled"), &Camera2D::is_limit_smoothing_enabled);

	ClassDB::bind_method(D_METHOD("set_v_drag_enabled", "enabled"), &Camera2D::set_v_drag_enabled);
	ClassDB::bind_method(D_METHOD("is_v_drag_enabled"), &Camera2D::is_v_drag_enabled);

	ClassDB::bind_method(D_METHOD("set_h_drag_enabled", "enabled"), &Camera2D::set_h_drag_enabled);
	ClassDB::bind_method(D_METHOD("is_h_drag_enabled"), &Camera2D::is_h_drag_enabled);

	ClassDB::bind_method(D_METHOD("set_v_offset", "ofs"), &Camera2D::set_v_offset);
	ClassDB::bind_method(D_METHOD("get_v_offset"), &Camera2D::get_v_offset);

	ClassDB::bind_method(D_METHOD("set_h_offset", "ofs"), &Camera2D::set_h_offset);
	ClassDB::bind_method(D_METHOD("get_h_offset"), &Camera2D::get_h_offset);

	ClassDB::bind_method(D_METHOD("set_drag_margin", "margin", "drag_margin"), &Camera2D::set_drag_margin);
	ClassDB::bind_method(D_METHOD("get_drag_margin", "margin"), &Camera2D::get_drag_margin);

	ClassDB::bind_method(D_METHOD("get_camera_pos"), &Camera2D::get_camera_pos);
	ClassDB::bind_method(D_METHOD("get_camera_screen_center"), &Camera2D::get_camera_screen_center);

	ClassDB::bind_method(D_METHOD("set_zoom", "zoom"), &Camera2D::set_zoom);
	ClassDB::bind_method(D_METHOD("get_zoom"), &Camera2D::get_zoom);

	ClassDB::bind_method(D_METHOD("set_custom_viewport", "viewport"), &Camera2D::set_custom_viewport);
	ClassDB::bind_method(D_METHOD("get_custom_viewport"), &Camera2D::get_custom_viewport);

	ClassDB::bind_method(D_METHOD("set_follow_smoothing", "follow_smoothing"), &Camera2D::set_follow_smoothing);
	ClassDB::bind_method(D_METHOD("get_follow_smoothing"), &Camera2D::get_follow_smoothing);

	ClassDB::bind_method(D_METHOD("set_enable_follow_smoothing", "follow_smoothing"), &Camera2D::set_enable_follow_smoothing);
	ClassDB::bind_method(D_METHOD("is_follow_smoothing_enabled"), &Camera2D::is_follow_smoothing_enabled);

	ClassDB::bind_method(D_METHOD("force_update_scroll"), &Camera2D::force_update_scroll);
	ClassDB::bind_method(D_METHOD("reset_smoothing"), &Camera2D::reset_smoothing);
	ClassDB::bind_method(D_METHOD("align"), &Camera2D::align);

	ClassDB::bind_method(D_METHOD("_set_old_smoothing", "follow_smoothing"), &Camera2D::_set_old_smoothing);

	ClassDB::bind_method(D_METHOD("set_screen_drawing_enabled", "screen_drawing_enabled"), &Camera2D::set_screen_drawing_enabled);
	ClassDB::bind_method(D_METHOD("is_screen_drawing_enabled"), &Camera2D::is_screen_drawing_enabled);

	ClassDB::bind_method(D_METHOD("set_limit_drawing_enabled", "limit_drawing_enabled"), &Camera2D::set_limit_drawing_enabled);
	ClassDB::bind_method(D_METHOD("is_limit_drawing_enabled"), &Camera2D::is_limit_drawing_enabled);

	ClassDB::bind_method(D_METHOD("set_margin_drawing_enabled", "margin_drawing_enabled"), &Camera2D::set_margin_drawing_enabled);
	ClassDB::bind_method(D_METHOD("is_margin_drawing_enabled"), &Camera2D::is_margin_drawing_enabled);

	ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
	ADD_PROPERTY(PropertyInfo(Variant::INT, "anchor_mode", PROPERTY_HINT_ENUM, "Fixed TopLeft,Drag Center"), "set_anchor_mode", "get_anchor_mode");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotating"), "set_rotating", "is_rotating");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "current"), "_set_current", "is_current");
	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "zoom"), "set_zoom", "get_zoom");

	ADD_GROUP("Limit", "limit_");
	ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_left"), "set_limit", "get_limit", MARGIN_LEFT);
	ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_top"), "set_limit", "get_limit", MARGIN_TOP);
	ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_right"), "set_limit", "get_limit", MARGIN_RIGHT);
	ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_bottom"), "set_limit", "get_limit", MARGIN_BOTTOM);
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "limit_smoothed"), "set_limit_smoothing_enabled", "is_limit_smoothing_enabled");

	ADD_GROUP("Draw Margin", "draw_margin_");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "drag_margin_h_enabled"), "set_h_drag_enabled", "is_h_drag_enabled");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "drag_margin_v_enabled"), "set_v_drag_enabled", "is_v_drag_enabled");

	ADD_GROUP("Smoothing", "smoothing_");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smoothing_enabled"), "set_enable_follow_smoothing", "is_follow_smoothing_enabled");
	ADD_PROPERTY(PropertyInfo(Variant::REAL, "smoothing_speed"), "set_follow_smoothing", "get_follow_smoothing");

	ADD_GROUP("Drag Margin", "drag_margin_");
	ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_LEFT);
	ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_top", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_TOP);
	ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_right", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_RIGHT);
	ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_bottom", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_BOTTOM);

	ADD_GROUP("Editor", "editor_");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_draw_screen"), "set_screen_drawing_enabled", "is_screen_drawing_enabled");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_draw_limits"), "set_limit_drawing_enabled", "is_limit_drawing_enabled");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_draw_drag_margin"), "set_margin_drawing_enabled", "is_margin_drawing_enabled");

	BIND_ENUM_CONSTANT(ANCHOR_MODE_DRAG_CENTER);
	BIND_ENUM_CONSTANT(ANCHOR_MODE_FIXED_TOP_LEFT);
}