Class KX_Camera -- Blender Game Engine 2.49b



 
   




getScreenRay

getScreenRay(x, y, dist, prop)

Looks towards a screen coordinate and returns the 1st game object hit with the property named and within the distance specified.
    
Returns:
KX_GameObject
or
None (if didn't find a game object)

x:
x screen coordinate
Type:  
float
y:
y screen coordinate
Type:  
float
dist :
maximum distance to look:
use negative distance to look behind
0.0 equals unlimited distance to look.
Type:
float
 property:
property name to look for
no property name equals look for all property names.
Type:
string

Sample Code

# get the current scene
scene = GameLogic.getCurrentScene()

# get the active camera
cam = scene.active_camera

# get 1st object with property "Blue_Player"
obj = cam.getScreenRay(0.5, 0.5, 7.0, "Blue_Player")

 
Game developers can use the game engine to create casual video games, first and third person shooters, role playing games, racing simulations and more. The game engine can be used to make both 2D games and 3D games.  Beginning game developers will only need basic knowledge of game design and programming to create rich and complex game models with photo realistic textures to add detail to the graphics of the video game.  Today's games need more than good looking low polygon game models.  Use normal maps and photo realistic textures to create high quality game models.