vertex_colour

Set the colour and alpha for the vertex.

Syntax:

vertex_colour(buffer, colour, alpha);


Argument Description
buffer The buffer to write the information to.
colour The colour for this vertex (can be a constant or a hex value).
alpha The alpha value for the vertex (from 0 to 1).


Returns: N/A


Description

If your defined vertex format takes a colour value you can use this function to add that data to the vertex being defined for the current primitive. The function needs a buffer to store the data in and will take either a colour constant, or a hex value (using the standard GameMaker: Studio format of BGR, eg: $FF0000 for blue) as well as an alpha value from 0 (transparent) to 1 (fully opaque).


Example:

vertex_colour(b, c_white, 1);

The above code will set the vertex being defined to be white with an alpha value of 1.


Back: Building Primitives
Next: vertex_normal
© Copyright YoYo Games Ltd. 2018 All Rights Reserved