Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorThomas Szepe <HG1_public@gmx.net>2015-03-24 02:23:40 +0300
committerThomas Szepe <HG1_public@gmx.net>2015-03-24 02:23:40 +0300
commitfd22a92939dc937216f50d1350a63de872e0a6be (patch)
treeb0b2c22078c347ec0e033d48f02e7e878e817864 /doc
parent6c9502a6c1e8637922991171680986f1c9a17f6e (diff)
BGE: Add new world API KX_WorldInfo (KX_Scene)
This Patch will add a the world API (mist, background, ambient) to KX_WorldInfo. The new API uses now attributes. Reviewers: campbellbarton, moguri Reviewed By: moguri Subscribers: klauser, brecht Differential Revision: https://developer.blender.org/D157
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/rst/bge.render.rst35
-rw-r--r--doc/python_api/rst/bge_types/bge.types.KX_Scene.rst6
-rw-r--r--doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst87
3 files changed, 111 insertions, 17 deletions
diff --git a/doc/python_api/rst/bge.render.rst b/doc/python_api/rst/bge.render.rst
index 09d16f4b2ed..2d47244bf7a 100644
--- a/doc/python_api/rst/bge.render.rst
+++ b/doc/python_api/rst/bge.render.rst
@@ -89,15 +89,15 @@ Constants
.. data:: KX_MIST_QUADRATIC
- Type of quadratic attenuation used to fade mist.
+ Type of quadratic attenuation used to fade mist. (Deprecated: use KX_WorldInfo.KX_MIST_QUADRATIC)
.. data:: KX_MIST_LINEAR
- Type of linear attenuation used to fade mist.
+ Type of linear attenuation used to fade mist. (Deprecated: use KX_WorldInfo.KX_MIST_LINEAR)
.. data:: KX_MIST_INV_QUADRATIC
- Type of inverse quadratic attenuation used to fade mist.
+ Type of inverse quadratic attenuation used to fade mist. (Deprecated: use KX_WorldInfo.KX_MIST_INV_QUADRATIC)
*********
@@ -173,50 +173,51 @@ Functions
.. function:: setBackgroundColor(rgba)
- Sets the window background color.
-
+ Sets the window background color. (Deprecated: use KX_WorldInfo.background_color)
+
:type rgba: list [r, g, b, a]
.. function:: setAmbientColor(rgb)
- Sets the color of ambient light.
-
+ Sets the color of ambient light. (Deprecated: use KX_WorldInfo.ambient_color)
+
:type rgb: list [r, g, b]
.. function:: setMistColor(rgb)
- Sets the mist color.
-
+ Sets the mist color. (Deprecated: use KX_WorldInfo.mist_color)
+
:type rgb: list [r, g, b]
.. function:: setMistType(mode)
- Sets the mist attenuation type.
+ Sets the mist attenuation type. (Deprecated: use KX_WorldInfo.mist_type)
:type mode: KX_MIST_QUADRATIC, KX_MIST_LINEAR, KX_MIST_INV_QUADRATIC
.. function:: setMistStart(start)
- Sets the mist start value. Objects further away than start will have mist applied to them.
-
+ Sets the mist start value. Objects further away than start will have mist applied to them.
+ (Deprecated: use KX_WorldInfo.mist_start)
+
:type start: float
.. function:: setMistEnd(end)
Sets the mist end value. Objects further away from this will be colored solid with
- the color set by setMistColor().
-
+ the color set by setMistColor(). (Deprecated: use KX_WorldInfo.mist_distance)
+
:type end: float
.. function:: setMistIntensity(intensity)
- Sets the mist intensity value.
+ Sets the mist intensity value. (Deprecated: use KX_WorldInfo.mist_intensity)
:type start: float
@@ -225,12 +226,12 @@ Functions
Disables mist.
- .. note:: Deprecated use setUseMist().
+ .. note:: Deprecated: use KX_WorldInfo.mist_enable.
.. function:: setUseMist(enable)
- Disable or enable the mist.
+ Disable or enable the mist. (Deprecated: use KX_WorldInfo.mist_enable)
:type enable: boolean
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst b/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst
index fc5ba357add..255ff95ad37 100644
--- a/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst
+++ b/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst
@@ -83,6 +83,12 @@ base class --- :class:`PyObjectPlus`
This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
+ .. attribute:: world
+
+ The current active world, (read-only).
+
+ :type: :class:`KX_WorldInfo`
+
.. attribute:: suspended
True if the scene is suspended, (read-only).
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst b/doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst
new file mode 100644
index 00000000000..ffc24b4e6c5
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst
@@ -0,0 +1,87 @@
+KX_WordlInfo(PyObjectPlus)
+=============================
+
+.. module:: bge.types
+
+base class --- :class:`PyObjectPlus`
+
+.. class:: KX_WorldInfo(PyObjectPlus)
+
+ A wolrd object.
+
+ .. code-block:: python
+
+ # Set the mist color to red.
+ import bge
+
+ sce = bge.logic.getCurrentScene()
+
+ sce.world.mist_color = [1.0, 0.0, 0.0]
+
+*********
+Constants
+*********
+
+ .. data:: KX_MIST_QUADRATIC
+
+ Type of quadratic attenuation used to fade mist.
+
+ .. data:: KX_MIST_LINEAR
+
+ Type of linear attenuation used to fade mist.
+
+ .. data:: KX_MIST_INV_QUADRATIC
+
+ Type of inverse quadratic attenuation used to fade mist.
+
+**********
+Attributes
+**********
+
+ .. attribute:: mist_enable
+
+ Return the state of the mist.
+
+ :type: bool
+
+ .. attribute:: mist_start
+
+ The mist start point.
+
+ :type: float
+
+ .. attribute:: mist_distance
+
+ The mist distance fom the start point to reach 100% mist.
+
+ :type: float
+
+ .. attribute:: mist_intensity
+
+ The mist intensity.
+
+ :type: float
+
+ .. attribute:: mist_type
+
+ The type of mist - must be KX_MIST_QUADRATIC, KX_MIST_LINEAR or KX_MIST_INV_QUADRATIC
+
+ .. attribute:: mist_color
+
+ The color of the mist. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
+ Mist and background color sould always set to the same color.
+
+ :type: :class:`mathutils.Vector`
+
+ .. attribute:: background_color
+
+ The color of the background. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
+ Mist and background color sould always set to the same color.
+
+ :type: :class:`mathutils.Vector`
+
+ .. attribute:: ambient_color
+
+ The color of the ambient light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
+
+ :type: :class:`mathutils.Vector`