This page what is for now a straight forward reference to the scripting objects available in Gluon's scripting API, and lists all the functions available on them from within game logic scripts:

Firstly, all the GluonObject classes as found in the Gluon API documentation are available, and all functions marked with the Q_INVOKABLE flag, or which are slots, are available and can be called from game logic.

Perform the dot product operation on the two vectors passed to this function, and return the result

Add this object and QVector2D together, andPu return the resulting vector

Add the passed QVector2D to this object, and assign the result to the current instance

Divide this object by the passed number, and return the result

Divide this object by the passed number and assign the result to the current instance

Check whether this object is equal to the passed value (that is, each component is compared, and if all are equal, the result is true)

Returns true if the x and y coordinates are set to 0.0, otherwise returns false.

Returns the length of the vector from the origin.

Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.

Returns a QVector2D object that is the sum of the given vectors, v1 and v2; each component is added separately.

Adds the given vector to this vector and returns a reference to this vector.

Multiplies a copy of this vector's coordinates by the given factor, and returns a reference to this vector.

Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.

Returns the normalized unit vector form of this vector.

If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.

Read data into this object from the passed QDataStream.

Set the x component to Number.

Set the y component to Number

Returns a QVector2D object that is formed by subtracting v2 from v1; each component is subtracted separately.

Subtracts the given vector from this vector and returns a reference to this vector.

Returns the QPoint form of this 2D vector.

Returns the QPointF form of this 2D vector.

Returns the string representation of this vector.

Returns the 3D form of this 2D vector, with the z coordinate set to zero.

Returns the 4D form of this 2D vector, with the z and w coordinates set to zero.

Write the data from this vector into the QDataStream.

Return the x component of this vector

Return the y component of this vector

Returns the cross-product of the two passed vectors, which corresponds to the normal vector of a plane defined by them.

Returns the dot product of the two passed vectors

Returns the cross-product of the two passed vectors, which corresponds to the normal vector of a plane defined by them, normalized to be a unit vector.

Use crossProduct() to compute the cross-product if you do not need the result to be normalized to a unit vector.

Returns the distance that this vertex is from a line defined by point and the unit vector direction.

If direction is a null vector, then it does not define a line. In that case, the distance from point to this vertex is returned.

Returns the distance that this vertex is from a line defined by point and the unit vector direction.

If direction is a null vector, then it does not define a line. In that case, the distance from point to this vertex is returned.

Returns the distance from this vertex to a plane defined by the vertex plane and a normal unit vector. The normal parameter is assumed to have been normalized to a unit vector.

The return value will be negative if the vertex is below the plane, or zero if it is on the plane.

Returns true if the x, y, and z coordinates are set to 0.0, otherwise returns false.

Returns the length of the vector from the origin.

Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.

Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.

Returns the normalized unit vector form of this vector.

If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.

Add the passed vector to the current instance, and return a reference to this vector.

Divide this object by the Number and assign the result to the current instance

Check whether this object is equal to the passed value (if all components are equal the resoult is True)

Adds the given vector to this vector and returns a reference to this vector.

Subtracts the given vector from this vector and returns a reference to this vector.

Read data from QDataStream to that object.

Sets the x coordinate of this point to Number.

Sets the x coordinate of this point to Number.

Sets the y coordinate of this point to Number.

Returns the QPoint form of this 3D vector. The z coordinate is dropped.

Returns the QPointF form of this 3D vector. The z coordinate is dropped.

Returns the 2D vector form of this 3D vector, dropping the z coordinate.

Returns the 4D form of the 3D vector, with the w coordinate set to zero.

Write the data from this vector to passed QDataStream.

Returns the x coordinate of this point.

Returns the y coordinate of this point.

Returns the z coordinate of this point.

Returns a string representing this vector.

Add the object and QVector3D together, returns the resulting vector

Returns QVector3D object that is formed by subtracting vector2 from vector1; each component is subtracted separately.

Returns QVector3D object that is sum of the given vectors, vector1 and vector2; each component is added separately.

Divide this object by Number, returns the result

Multiplies a copy of the vector's coordinates by the given Number, returns a reference to this vector.

Returns the dot product of v1 and v2.

Constructs a vector setting coordinations x, y, z, w to Numberx, Numbery, Numberz and Numberw.

Returns true if the x, y, z, and w coordinates are set to 0.

Returns the length of the vector.

Returns the squared length of the vector.

Normalizes the currect vector in place.

Sets the w coordinate of this point to the given Number.

Sets the x coordinate of this point to the given Number.

Sets the y coordinate of this point to the given Number.

Sets the z coordinate of this point to the given Number.

Returns the QPoint form of this vector. The z and w coordinates are dropped.

Returns the QPointF form of this vector. The z and w coordinates are dropped.

Returns the 2D vector form of this 4D vector, dropping the z and w coordinates.

Returns the 2D vector form of this 4D vector, dividing the x and y coordinates by the w coordinate and dropping the z coordinate. Returns a null vector if w is zero.

Returns the 3D vector form of this 4D vector, dropping the w coordinate.

Returns the 3D vector form of this 4D vector, dividing the x, y, and z coordinates by the w coordinate. Returns a null vector if w is zero.

Returns the x coordinate.

Returns the y coordinate.

Returns the z coordinate.

Returns the w coordinate.

Creates a normalized quaternion that corresponds to rotating through angle degrees about the specified 3D axis.

Interpolates along the shortest linear path between the rotational positions q1 and q2. The value t should be between 0 and 1, indicating the distance to travel between q1 and q2. The result will be normalized().

If t is less than or equal to 0, then q1 will be returned. If t is greater than or equal to 1, then q2 will be returned.

Interpolates along the shortest spherical path between the rotational positions q1 and q2. The value t should be between 0 and 1, indicating the spherical distance to travel between q1 and q2.

Constructs a quaternion with the vector (x,y,z) and scalar.

Returns the conjugate of this quaternion, which is (-x, -y, -z, scalar).

Returns true if the x, y, and z are set to 0.0, and the scalar is set to 1.0; else returns false.

Returns true if the x, y, z, and scalar are set to 0.0; else returns false.

Returns the length of the quaternion.

Returns the squared length.

Normalizes the currect quaternion in place.

Rotates vector with this quaternion to produce a new vector in 3D space.

Returns the scalar.

Sets the scalar component yo given Number.

Sets the vector component of this quaternion to vector

Sets the x coordinate.

Sets the z coordinate.

Sets the z coordinate.

Returns this quaternion as a 4D vector.

Returns the vector component of quaternion.

Returns the x coordinate.

Returns the y coordinate.

Returns the z coordinate.

Returns true if setNamedColor() is allowed to look up colors in the X11 color database.

Returns a QStringList containing the color names Qt knows.

Returns QColor constructed from given CMYK color values: c (cyan), m (magenta), y (yellow), k (black), and a (alpha-channel, i.e. transparency).

Returns a QColor constructed from the HSV color values, h (hue), s (saturation), l (lightness), and a (alpha-channel, i.e. transparency).

Returns a QColor constructed from the HSV color values, h (hue), s (saturation), v (value), and a (alpha-channel, i.e. transparency).

Returns a QColor constructed from the given QRgb value rgb.

Returns a QColor constructed from the RGB color values, r (red), g (green), b (blue), and a (alpha-channel, i.e. transparency).

Returns a QColor constructed from the given QRgb value rgba.

Returns true if the name is a valid color name and can be used to construct a valid QColor object, else returns false.

Allow setNamedColor() to look up colors in the X11 color database if given argument is Truth.

Constructs an invalid color with gives RGB values.

Returns the alpha color component of this color.

Returns the black color component of this color.

Returns the blue color component of this color.

Creates a copy of this color in the format specified by colorSpec.

Returns the cyan color component of this color.

Returns a darker (or lighter) color, but does not change this object.

Sets the contents pointed to by c, m, y, k, and a, to the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color's CMYK value.

Sets the contents pointed to by h, s, l, and a, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value.

Sets the contents pointed to by h, s, v, and a, to the hue, saturation, value, and alpha-channel (transparency) components of the color's HSV value.

Sets the contents pointed to by r, g, b, and a, to the red, green, blue, and alpha-channel (transparency) components of the color's RGB value

Returns the green color component of this color.

Returns the hue color component of this color.

Returns the saturation color component of this color.

Returns the hue color component of this color.

Returns the saturation color component of this color.

Returns the hue color component of this color.

Returns true if the color is valid; else returns false.

Returns a lighter (or darker) color, but does not change this object.

Returns the lightness color component of this color.

Returns the magenta color component of this color.

Returns the name of the color in the format "#RRGGBB".

Returns the red color component of this color.

Returns the yellow color component of this color.

Returns the RGB value of the color. Alpha is dropped.

Returns the RGB value of the color Including alpha.

Returns the saturation color component of this color.

Sets the alpha of this color to Number.

Sets the blue color component of this color to Number.

Sets the color to CMYK values, c (cyan), m (magenta), y (yellow), k (black), and a (alpha-channel, i.e. transparency).

Sets the green color component of this color to Number.

Sets the red color component of this color to Number.

Sets a HSL color value; h is the hue, s is the saturation, l is the lightness and a is the alpha component of the HSL color.

Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha component of the HSV color.

Sets the RGB value of this QColor to name.

Sets the RGB value to r, g, b and the alpha value to a.

Sets the RGB value to rgba, including its alpha.

Returns the specification of color.

Creates and returns a CMYK QColor based on this color.

Creates and returns an HSL QColor based on this color.

Creates and returns an HSV QColor based on this color.

Create and returns an RGB QColor based on this color.

Returns the value color component of this color.

Constructs a size with floating point accuracy from the given size.

Constructs a size with the given width = Number1 and height = Number.

Returns a size holding the minimum width and height of this size and the given otherSize.

Returns a size holding the maximum width and height of this size and the given otherSize.

Returns the height.

Returns true if width or height is less than or equal to 0; else returns false.

Returns true if width and height are higher then +0.0; otherwise returns false.

Returns true if width and height is equal or greater than 0; else return false.

Returns a reference to height.

Returns a reference to width.

Returns the width.

Scales the size to a rectangle with the given width and height, according to the specified mode.

Sets the height to given Number.

Sets the width to given Number.

Returns an integer based copy of this size.

Swaps the height and widtht values.

- Printer-friendly version
- Login to post comments