Scripting Reference

  • strict warning: Non-static method view::load() should not be called statically in /home/gamingfreedom/gluon-site/sites/all/modules/views/views.module on line 879.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/gamingfreedom/gluon-site/sites/all/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/gamingfreedom/gluon-site/sites/all/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/gamingfreedom/gluon-site/sites/all/modules/views/plugins/views_plugin_row.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/gamingfreedom/gluon-site/sites/all/modules/views/plugins/views_plugin_row.inc on line 0.

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.

QVector2D

Static functions

dotProduct(QVector2D,QVector2D)

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

Object functions

add(QVector2D)

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

addOther(QVector2D)

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

divide(Number)

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

divideBy(Number)

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

equals(QVector2D)

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)

isNull()

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

length()

Returns the length of the vector from the origin.

lengthSquared()

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

multiply(Number)

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

multiplyBy(Number)

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

multiplyComponents(QVector2D)

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

normalize()

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.

normalized()

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.

readFrom(QDataStream)

Read data into this object from the passed QDataStream.

setX(Number)

Set the x component to Number.

setY(Number)

Set the y component to Number

subtract(QVector2D)

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

subtractOther(QVector2D)

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

toPoint()

Returns the QPoint form of this 2D vector.

toPointF()

Returns the QPointF form of this 2D vector.

toString()

Returns the string representation of this vector.

toVector3D()

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

toVector4D()

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

writeTo(QDataStream)

Write the data from this vector into the QDataStream.

x()

Return the x component of this vector

y()

Return the y component of this vector

QVector3D

Static Functions

crossProduct(QVector3D,QVector3D)

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

dotProduct(QVector3D,QVector3D)

Returns the dot product of the two passed vectors

normal(QVector3D,QVector3D)

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.

Object Functions

distanceToLine(QVector3D point,QVector3D direction)

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.

distanceToPlane(QVector3D plane, QVector3D normal)

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.

distanceToPlane(QVector3D plane1, QVector3D plane2, QVector3D plane3)

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.

isNull()

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

length()

Returns the length of the vector from the origin.

lengthSquared()

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

normalize()

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.

normalized()

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.

addOther(QVector3D)

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

divideBy(Number)

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

equals(QVector3D)

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

multiplyBy(Number)

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

subtractOther(QVector3D)

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

readFrom(QDataStream)

Read data from QDataStream to that object.

setX (Number)

Sets the x coordinate of this point to Number.

setY(Number)

Sets the x coordinate of this point to Number.

setZ(Number)

Sets the y coordinate of this point to Number.

toPoint()

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

toPointF()

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

toVector2D()

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

toVector4D()

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

writeTo(QDataStream)

Write the data from this vector to passed QDataStream.

x()

Returns the x coordinate of this point.

y()

Returns the y coordinate of this point.

z()

Returns the z coordinate of this point.

toString()

Returns a string representing this vector.

add(QVector3D)

Add the object and QVector3D together, returns the resulting vector

subtrac(QVector3D)

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

multiply(Number)

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

divide(Number)

Divide this object by Number, returns the result

multiplyComponents(QVector3D)

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

QVector4D

Static functions

dotProduct ( QVector4D & v1, QVector4D & v2 )

Returns the dot product of v1 and v2.

Object Functions

QVector4D ( Numberx Numbery, Numberz, Numberw )

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

isNull ()

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

length ()

Returns the length of the vector.

lengthSquared ()

Returns the squared length of the vector.

normalize ()

Normalizes the currect vector in place.

setW (Number)

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

setX (Number)

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

setY (Number)

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

setZ (Number)

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

toPoint ()

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

toPointF()

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

toVector2D ()

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

toVector2DAffine ()

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.

toVector3D ()

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

toVector3DAffine ()

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.

x ()

Returns the x coordinate.

y ()

Returns the y coordinate.

z ()

Returns the z coordinate.

w ()

Returns the w coordinate.

QQuaternion

Static Functions

fromAxisAndAngle (QVector3D & axis, Number)

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

nlerp (QQuaternion & q1, QQuaternion & q2, t)

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.

slerp (QQuaternion & q1, QQuaternion & q2, t)

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.

Object Functions

QQuaternion (Numbe r, Number x, Number y, Number z)

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

conjugate ()

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

isIdentity ()

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

isNull ()

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

length ()

Returns the length of the quaternion.

lengthSquared ()

Returns the squared length.

normalize ()

Normalizes the currect quaternion in place.

rotatedVector ( QVector3D & vector )

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

scalar ()

Returns the scalar.

setScalar (Number)

Sets the scalar component yo given Number.

setVector (QVector3D &vector)

Sets the vector component of this quaternion to vector

setX (Number)

Sets the x coordinate.

setX (Number)

Sets the z coordinate.

setX (Number)

Sets the z coordinate.

toVector4D ()

Returns this quaternion as a 4D vector.

vector ()

Returns the vector component of quaternion.

x ()

Returns the x coordinate.

y ()

Returns the y coordinate.

z ()

Returns the z coordinate.

QColor

Static Functions

allowX11ColorNames ()

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

colorNames ()

Returns a QStringList containing the color names Qt knows.

fromCmyk (Number c, Number m, Number y, Number k, Number a = 255)

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

fromHsl (Number h, Number s, Number l, Number a = 255 )

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

fromHsv (Number h, Number s, Number v, Number a = 255 )

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

fromRgb (QRGB)

Returns a QColor constructed from the given QRgb value rgb.

fromRgbF (Number r, Number g, Number b, Number a = 1.0)

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

fromRgba ( QRgb rgba )

Returns a QColor constructed from the given QRgb value rgba.

isValidColor ( QString & name )

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

setAllowX11ColorNames ( boolean )

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

Object Functions

QColor ( Number r, Number g, Number b, Number a = 255 )

Constructs an invalid color with gives RGB values.

alpha()

Returns the alpha color component of this color.

black ()

Returns the black color component of this color.

blue ()

Returns the blue color component of this color.

convertTo ( Spec colorSpec )

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

cyan ()

Returns the cyan color component of this color.

darker (Number)

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

getCmyk ( Number c, Number m, Number y, Number k, Number a = 0 )

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.

getHsl ( Number h, Number s, Number l, Number a = 0 )

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.

getHsv (Number h, Number s, Number v, Number a = 0 )

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.

getRgb ( Number r, Number g, Number b, Number a = 0 )

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

green ()

Returns the green color component of this color.

hslHue ()

Returns the hue color component of this color.

hslSaturation ()

Returns the saturation color component of this color.

hsvHue ()

Returns the hue color component of this color.

hsvSaturation ()

Returns the saturation color component of this color.

hue ()

Returns the hue color component of this color.

isValid ()

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

lighter ( Number factor )

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

lightness ()

Returns the lightness color component of this color.

magenta ()

Returns the magenta color component of this color.

name ()

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

red ()

Returns the red color component of this color.

yellow ()

Returns the yellow color component of this color.

rgb ()

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

rgba ()

Returns the RGB value of the color Including alpha.

saturation ()

Returns the saturation color component of this color.

setAlpha (Number)

Sets the alpha of this color to Number.

setBlue (Number)

Sets the blue color component of this color to Number.

setCmyk (Number c, Number m,Number y, Number k, Number a = 255)

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

setGreen ()

Sets the green color component of this color to Number.

setRed (Number)

Sets the red color component of this color to Number.

setHsl (Number h, Number s, Number l, Number a = 255)

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.

setHsv (Number h, Number s, Number v, Number a = 255)

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.

setNamedColor (QString & name)

Sets the RGB value of this QColor to name.

setRgb ( Number r, Number g, Number b, Number a = 255)

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

setRgba (QRgb rgba)

Sets the RGB value to rgba, including its alpha.

spec ()

Returns the specification of color.

toCmyk ()

Creates and returns a CMYK QColor based on this color.

toHsl ()

Creates and returns an HSL QColor based on this color.

toHsv ()

Creates and returns an HSV QColor based on this color.

toRgb ()

Create and returns an RGB QColor based on this color.

value ()

Returns the value color component of this color.

QSizeF

QSizeF (QSize & size)

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

QSizeF (Number1, Number2)

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

boundedTo (QSizeF & otherSize)

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

QSizeF QSizeF::expandedTo (QSizeF & otherSize)

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

height ()

Returns the height.

isEmpty ()

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

isNull ()

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

isValid ()

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

rheight ()

Returns a reference to height.

rwidth ()

Returns a reference to width.

width ()

Returns the width.

scale (width, height, Qt::AspectRatioMode mode)

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

setHeight (Number)

Sets the height to given Number.

setWidth (Number)

Sets the width to given Number.

toSize ()

Returns an integer based copy of this size.

transpose ()

Swaps the height and widtht values.