[DOCS] CanvasItem/Material/Layer, ClassDB, CollisionObject(2D)

This commit is contained in:
Will Nations 2017-12-07 13:17:08 -06:00
parent 6527f2e684
commit a9c9499c73
6 changed files with 45 additions and 3 deletions

View File

@ -119,6 +119,7 @@
<argument index="3" name="antialiased" type="bool" default="false"> <argument index="3" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
Draw a polyline with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing.
</description> </description>
</method> </method>
<method name="draw_polyline_colors"> <method name="draw_polyline_colors">
@ -133,6 +134,7 @@
<argument index="3" name="antialiased" type="bool" default="false"> <argument index="3" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
Draw a polyline with a uniform [code]width[/code], segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
</description> </description>
</method> </method>
<method name="draw_primitive"> <method name="draw_primitive">
@ -177,7 +179,7 @@
<argument index="2" name="scale" type="Vector2"> <argument index="2" name="scale" type="Vector2">
</argument> </argument>
<description> <description>
Set a custom transform for drawing. Anything drawn afterwards will be transformed by this. Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this.
</description> </description>
</method> </method>
<method name="draw_set_transform_matrix"> <method name="draw_set_transform_matrix">
@ -186,6 +188,7 @@
<argument index="0" name="xform" type="Transform2D"> <argument index="0" name="xform" type="Transform2D">
</argument> </argument>
<description> <description>
Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this.
</description> </description>
</method> </method>
<method name="draw_string"> <method name="draw_string">
@ -359,6 +362,7 @@
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns [code]true[/code] if local transform notifications are communicated to children.
</description> </description>
</method> </method>
<method name="is_set_as_toplevel" qualifiers="const"> <method name="is_set_as_toplevel" qualifiers="const">
@ -372,12 +376,14 @@
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns [code]true[/code] if global transform notifications are communicated to children.
</description> </description>
</method> </method>
<method name="is_visible_in_tree" qualifiers="const"> <method name="is_visible_in_tree" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns [code]true[/code] if the node is in the [SceneTree] and is visible on-screen.
</description> </description>
</method> </method>
<method name="make_canvas_position_local" qualifiers="const"> <method name="make_canvas_position_local" qualifiers="const">
@ -386,6 +392,7 @@
<argument index="0" name="screen_point" type="Vector2"> <argument index="0" name="screen_point" type="Vector2">
</argument> </argument>
<description> <description>
Assigns [code]screen_point[/code] as this node's new local transform.
</description> </description>
</method> </method>
<method name="make_input_local" qualifiers="const"> <method name="make_input_local" qualifiers="const">
@ -394,6 +401,7 @@
<argument index="0" name="event" type="InputEvent"> <argument index="0" name="event" type="InputEvent">
</argument> </argument>
<description> <description>
Transformations issued by [code]event[/code]'s inputs are applied in local space instead of global space.
</description> </description>
</method> </method>
<method name="set_as_toplevel"> <method name="set_as_toplevel">
@ -402,7 +410,7 @@
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Set as top level. This means that it will not inherit transform from parent canvas items. Sets as top level. This means that it will not inherit transform from parent canvas items.
</description> </description>
</method> </method>
<method name="set_notify_local_transform"> <method name="set_notify_local_transform">
@ -411,6 +419,7 @@
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
If [code]enable[/code] is [code]true[/code], children will be updated with local transform data.
</description> </description>
</method> </method>
<method name="set_notify_transform"> <method name="set_notify_transform">
@ -419,6 +428,7 @@
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
If [code]enable[/code] is [code]true[/code], children will be updated with global transform data.
</description> </description>
</method> </method>
<method name="show"> <method name="show">
@ -438,20 +448,28 @@
</methods> </methods>
<members> <members>
<member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask"> <member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask">
The rendering layers in which this [code]CanvasItem[/code] responds to [Light2D] nodes. Default value: [code]1[/code].
</member> </member>
<member name="material" type="Material" setter="set_material" getter="get_material"> <member name="material" type="Material" setter="set_material" getter="get_material">
The material applied to textures on this [code]CanvasItem[/code]. Default value: [code]null[/code].
</member> </member>
<member name="modulate" type="Color" setter="set_modulate" getter="get_modulate"> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate">
The color applied to textures on this [code]CanvasItem[/code]. Default value: [code]Color(1, 1, 1, 1)[/code] (opaque "white").
</member> </member>
<member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate"> <member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate">
The color applied to textures on this [code]CanvasItem[/code]. This is not inherited by children [code]CanvasItem[/code]s. Default value: [code]Color(1, 1, 1, 1)[/code] (opaque "white")..
</member> </member>
<member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled"> <member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled">
If [code]true[/code] the object draws behind its parent. Default value: [code]false[/code].
</member> </member>
<member name="show_on_top" type="bool" setter="_set_on_top" getter="_is_on_top"> <member name="show_on_top" type="bool" setter="_set_on_top" getter="_is_on_top">
If [code]true[/code] the object draws on top of its parent. Default value: [code]true[/code].
</member> </member>
<member name="use_parent_material" type="bool" setter="set_use_parent_material" getter="get_use_parent_material"> <member name="use_parent_material" type="bool" setter="set_use_parent_material" getter="get_use_parent_material">
If [code]true[/code] the parent [code]CanvasItem[/code]'s [member material] property is used as this one's material. Default value: [code]false[/code].
</member> </member>
<member name="visible" type="bool" setter="set_visible" getter="is_visible"> <member name="visible" type="bool" setter="set_visible" getter="is_visible">
If [code]true[/code] this [code]CanvasItem[/code] is drawn. Default value: [code]true[/code].
</member> </member>
</members> </members>
<signals> <signals>

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="CanvasItemMaterial" inherits="Material" category="Core" version="3.0-beta"> <class name="CanvasItemMaterial" inherits="Material" category="Core" version="3.0-beta">
<brief_description> <brief_description>
A material for [CanvasItem]s.
</brief_description> </brief_description>
<description> <description>
[code]CanvasItemMaterial[/code]s provide a means of modifying the textures associated with a CanvasItem. They specialize in describing blend and lighting behaviors for textures. Use a [ShaderMaterial] to more fully customize a material's interactions with a [CanvasItem].
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -12,26 +14,36 @@
</methods> </methods>
<members> <members>
<member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="CanvasItemMaterial.BlendMode"> <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="CanvasItemMaterial.BlendMode">
The manner in which a material's rendering is applied to underlying textures.
</member> </member>
<member name="light_mode" type="int" setter="set_light_mode" getter="get_light_mode" enum="CanvasItemMaterial.LightMode"> <member name="light_mode" type="int" setter="set_light_mode" getter="get_light_mode" enum="CanvasItemMaterial.LightMode">
The manner in which material reacts to lighting.
</member> </member>
</members> </members>
<constants> <constants>
<constant name="BLEND_MODE_MIX" value="0" enum="BlendMode"> <constant name="BLEND_MODE_MIX" value="0" enum="BlendMode">
Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value.
</constant> </constant>
<constant name="BLEND_MODE_ADD" value="1" enum="BlendMode"> <constant name="BLEND_MODE_ADD" value="1" enum="BlendMode">
Additive blending mode.
</constant> </constant>
<constant name="BLEND_MODE_SUB" value="2" enum="BlendMode"> <constant name="BLEND_MODE_SUB" value="2" enum="BlendMode">
Subtractive blending mode.
</constant> </constant>
<constant name="BLEND_MODE_MUL" value="3" enum="BlendMode"> <constant name="BLEND_MODE_MUL" value="3" enum="BlendMode">
Multiplicative blending mode.
</constant> </constant>
<constant name="BLEND_MODE_PREMULT_ALPHA" value="4" enum="BlendMode"> <constant name="BLEND_MODE_PREMULT_ALPHA" value="4" enum="BlendMode">
Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value.
</constant> </constant>
<constant name="LIGHT_MODE_NORMAL" value="0" enum="LightMode"> <constant name="LIGHT_MODE_NORMAL" value="0" enum="LightMode">
Render the material using both light and non-light sensitive material properties.
</constant> </constant>
<constant name="LIGHT_MODE_UNSHADED" value="1" enum="LightMode"> <constant name="LIGHT_MODE_UNSHADED" value="1" enum="LightMode">
Render the material as if there were no light.
</constant> </constant>
<constant name="LIGHT_MODE_LIGHT_ONLY" value="2" enum="LightMode"> <constant name="LIGHT_MODE_LIGHT_ONLY" value="2" enum="LightMode">
Render the material as if there were only light.
</constant> </constant>
</constants> </constants>
</class> </class>

View File

@ -15,6 +15,7 @@
<return type="Node"> <return type="Node">
</return> </return>
<description> <description>
Returns the [Viewport] used by the camera if it is not using the default viewport.
</description> </description>
</method> </method>
<method name="get_rotation" qualifiers="const"> <method name="get_rotation" qualifiers="const">
@ -44,6 +45,7 @@
<argument index="0" name="viewport" type="Node"> <argument index="0" name="viewport" type="Node">
</argument> </argument>
<description> <description>
Assigns a custom [Viewport] node to the [code]CanvasLayer[/code]. If [code]viewport[/code] is not a [Viewport], it re-assigns the default viewport instead.
</description> </description>
</method> </method>
<method name="set_rotation"> <method name="set_rotation">

View File

@ -35,6 +35,7 @@
<argument index="0" name="class" type="String"> <argument index="0" name="class" type="String">
</argument> </argument>
<description> <description>
Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required.
</description> </description>
</method> </method>
<method name="class_get_integer_constant" qualifiers="const"> <method name="class_get_integer_constant" qualifiers="const">

View File

@ -25,6 +25,7 @@
<argument index="4" name="shape_idx" type="int"> <argument index="4" name="shape_idx" type="int">
</argument> </argument>
<description> <description>
Accepts unhandled [InputEvent]s. [code]click_position[/code] is the clicked location in world space and [code]click_normal[/code] is the normal vector extending from the clicked surface of the [Shape] at [code]shape_idx[/code]. Connect to the [code]input_event[/code] signal to easily pick up these events.
</description> </description>
</method> </method>
<method name="create_shape_owner"> <method name="create_shape_owner">
@ -134,6 +135,7 @@
<argument index="1" name="shape_id" type="int"> <argument index="1" name="shape_id" type="int">
</argument> </argument>
<description> <description>
Returns the child index of the [Shape] with the given id from the given shape owner.
</description> </description>
</method> </method>
<method name="shape_owner_get_transform" qualifiers="const"> <method name="shape_owner_get_transform" qualifiers="const">
@ -181,8 +183,10 @@
</methods> </methods>
<members> <members>
<member name="input_capture_on_drag" type="bool" setter="set_capture_input_on_drag" getter="get_capture_input_on_drag"> <member name="input_capture_on_drag" type="bool" setter="set_capture_input_on_drag" getter="get_capture_input_on_drag">
If [code]true[/code] the [code]CollisionObject[/code] will continue to receive input events as the mouse is dragged across its shapes. Default value: [code]false[/code].
</member> </member>
<member name="input_ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable"> <member name="input_ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable">
If [code]true[/code] the [CollisionObject]'s shapes will respond to [RayCast]s. Default value: [code]true[/code].
</member> </member>
</members> </members>
<signals> <signals>
@ -198,6 +202,7 @@
<argument index="4" name="shape_idx" type="int"> <argument index="4" name="shape_idx" type="int">
</argument> </argument>
<description> <description>
Emitted when [method _input_event] receives an event. See its description for details.
</description> </description>
</signal> </signal>
<signal name="mouse_entered"> <signal name="mouse_entered">

View File

@ -21,6 +21,7 @@
<argument index="2" name="shape_idx" type="int"> <argument index="2" name="shape_idx" type="int">
</argument> </argument>
<description> <description>
Accepts unhandled [InputEvent]s. [code]shape_idx[/code] is the child index of the clicked [Shape2D]. Connect to the [code]input_event[/code] signal to easily pick up these events.
</description> </description>
</method> </method>
<method name="create_shape_owner"> <method name="create_shape_owner">
@ -61,6 +62,7 @@
<argument index="0" name="owner_id" type="int"> <argument index="0" name="owner_id" type="int">
</argument> </argument>
<description> <description>
Returns [code]true[/code] if collisions for the shape owner originating from this [code]CollisionObject2D[/code] will not be reported to collided with [code]CollisionObject2D[/code]s.
</description> </description>
</method> </method>
<method name="remove_shape_owner"> <method name="remove_shape_owner">
@ -138,6 +140,7 @@
<argument index="1" name="shape_id" type="int"> <argument index="1" name="shape_id" type="int">
</argument> </argument>
<description> <description>
Returns the child index of the [Shape2D] with the given id from the given shape owner.
</description> </description>
</method> </method>
<method name="shape_owner_get_transform" qualifiers="const"> <method name="shape_owner_get_transform" qualifiers="const">
@ -179,6 +182,7 @@
<argument index="1" name="enable" type="bool"> <argument index="1" name="enable" type="bool">
</argument> </argument>
<description> <description>
If [code]enable[/code] is [code]true[/code], collisions for the shape owner originating from this [code]CollisionObject2D[/code] will not be reported to collided with [code]CollisionObject2D[/code]s.
</description> </description>
</method> </method>
<method name="shape_owner_set_transform"> <method name="shape_owner_set_transform">
@ -207,7 +211,7 @@
<argument index="2" name="shape_idx" type="int"> <argument index="2" name="shape_idx" type="int">
</argument> </argument>
<description> <description>
Emitted when an input event occurs and [code]input_pickable[/code] is [code]true[/code]. Emitted when an input event occurs and [code]input_pickable[/code] is [code]true[/code]. See [method _input_event] for details.
</description> </description>
</signal> </signal>
<signal name="mouse_entered"> <signal name="mouse_entered">