Vertex Proxy: getRGBA

getRGBA()
  • gets the vertex color.

Return Type:

  • integer
Note:
  • It returns the vertex color as a 4 byte integer with one byte per color channel in the RGBA format.
     
  • The color red is returned as (-16776961)
Sample Code

############################# get the color of the vertex

# import bge
import bge

# get the current controller
cont = bge.logic.getCurrentController()

# get object that owns this controller
obj = cont.owner
 
# Get a list of the mesh
meshList = obj.meshes

# Get the first mesh on the object
mesh = meshList[0]
 
# get the first vertex of the first material
vert  = mesh.getVertex( 0, 0)

# get the color
color = vert.getRGBA()