GameLogic with Python


How do I get properties of an object like size?
I am writing a Python code for a CUBE object so that the cube follow mouse movement. For this, I need to get the size property of the CUBE object. FI konw that obj.getSize() works for Blender-Python API but it is not working for GameLogic.

Can somebody tell me a good reference for the Python API for GameLogic?

Thanks in advance.



there is no getSize() for gamelogic but if im not mistaken you can calculate the size yourself with either getOrientation() or getVertex() :frowning:

well, this is the code for max “wideness”(not really sure what to call it)

import GameLogic


for i in range(0,arlen):
	for n in range(0,3):
		if vpos[n] > owner.max:
		if vpos[n] < owner.min:

print max

but why do you need to find size? there are a couple different ways i can think of to “grab” and move an object. if you gave me some details i’ll write a script for you :wink:

I have couple of objects that I would like to grab and move with mouse (on+left+move) combination.
Following is the script I found from this forum that works fine for a ‘Plane’ but does not work for an arbitrary mesh. I found it is because a ‘Plane’ mesh has attributes of xsize and ysize but not other meshes like ‘Cube’ or ‘Sphere’.

if mover.isPositive() and mleft.isPositive():
w = float(Rasterizer.getWindowWidth()/2)
h = float(Rasterizer.getWindowHeight()/2)
x = (mmove.getXPosition() - w) / wowner.xsize
y = (mmove.getYPosition() - h) / h
pos = owner.getPosition()
owner.setPosition([x, y, pos[2])

If you can teach me a simpler way to grap and move an arbitrary mesh object, that would be much appreciated.

Thanks in advnace