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
diff options
context:
space:
mode:
authorStephen Swaney <sswaney@centurytel.net>2005-10-11 19:11:39 +0400
committerStephen Swaney <sswaney@centurytel.net>2005-10-11 19:11:39 +0400
commitcf620b95d55856f1ba31169821945cea60aa1fd5 (patch)
tree56af88d7065f462c666f0c427aa566ed631edd62 /source/blender/python/api2_2x/doc/Draw.py
parenta84a75cfc32ca81fc0eaa51f25098fd5b0255df9 (diff)
Updates and corrections to the BPy doc. Patch #2975
A large chunk of documentation goodness from Campbell Barton (ideasman). Thanks! Note that any mispellings, errors, or inconsistencies are due to my ham-fisted editing.
Diffstat (limited to 'source/blender/python/api2_2x/doc/Draw.py')
-rw-r--r--source/blender/python/api2_2x/doc/Draw.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/doc/Draw.py b/source/blender/python/api2_2x/doc/Draw.py
index c97331c5cfe..b88eade5d00 100644
--- a/source/blender/python/api2_2x/doc/Draw.py
+++ b/source/blender/python/api2_2x/doc/Draw.py
@@ -7,7 +7,7 @@ Draw
====
B{New}:
- - access to ascii values in L{events<Register>} callbacks;
+ - access to ASCII values in L{events<Register>} callbacks;
- 'large' fonts for L{Text} and L{GetStringWidth}.
This module provides access to a B{windowing interface} in Blender. Its widgets
@@ -243,7 +243,7 @@ def Register(draw = None, event = None, button = None):
they will stay until Draw.Exit is called. It's enough to redraw the
screen, when a relevant event is caught.
@note: only during the B{event} callback: the L{Blender}.ascii variable holds
- the ascii integer value (if it exists and is valid) of the current event.
+ the ASCII integer value (if it exists and is valid) of the current event.
"""
def Redraw(after = 0):
@@ -632,6 +632,10 @@ def Image(image, x, y, zoomx=1.0, zoomy=1.0, clipx=0, clipy=0, clipw=-1, cliph=-
either the width or the height of the clipping rectangle are negative then
the corresponding dimension (width or height) is set to include as much of
the image as possible.
+
+ For drawing images with alpha blending with the background you will need to enable blending as shown in the example.
+
+
Example::
import Blender
@@ -640,7 +644,12 @@ def Image(image, x, y, zoomx=1.0, zoomy=1.0, clipx=0, clipy=0, clipw=-1, cliph=-
myimage = Image.Load('myimage.png')
def gui():
+ BGL.glEnable( BGL.GL_BLEND ) # Only needed for alpha blending images with background.
+ BGL.glBlendFunc(BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA)
+
Draw.Image(myimage, 50, 50)
+
+ BGL.glDisable( BGL.GL_BLEND )
def event(evt, val):
if evt == Draw.ESCKEY:
Draw.Exit()