Difference between revisions of "DxSetShaderTransform"

From Multi Theft Auto: Wiki
Jump to: navigation, search
Line 5: Line 5:
 
==Syntax==  
 
==Syntax==  
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
bool dxSetShaderTransform ( element shader,
+
bool dxSetShaderTransform ( element theShader,
 
                             float rotationX, float rotationY, float rotationZ,
 
                             float rotationX, float rotationY, float rotationZ,
 
                           [ float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, float rotationCenterOffsetZ = 0,
 
                           [ float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, float rotationCenterOffsetZ = 0,
Line 14: Line 14:
  
 
===Required Arguments===  
 
===Required Arguments===  
*'''shader:''' The shader element whose transformation is to be changed
+
*'''theShader:''' The shader element whose transformation is to be changed
 
*'''rotationX:''' Rotation angle in degrees around the X axis (Left,right). This will make the shader rotate along its width.
 
*'''rotationX:''' Rotation angle in degrees around the X axis (Left,right). This will make the shader rotate along its width.
 
*'''rotationY:''' Rotation angle in degrees around the Y axis (Up,down). This will make the shader rotate along its height.
 
*'''rotationY:''' Rotation angle in degrees around the Y axis (Up,down). This will make the shader rotate along its height.

Revision as of 11:57, 26 January 2013

This function applies a 3D transformation to a shader element when it is draw with dxDrawImage.

Syntax

bool dxSetShaderTransform ( element theShader,
                            float rotationX, float rotationY, float rotationZ,
                          [ float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, float rotationCenterOffsetZ = 0,
                            bool bRotationCenterOffsetOriginIsScreen = false,
                            float perspectiveCenterOffsetX = 0, float perspectiveCenterOffsetY = 0,
                            bool bPerspectiveCenterOffsetOriginIsScreen = false ] )

Required Arguments

  • theShader: The shader element whose transformation is to be changed
  • rotationX: Rotation angle in degrees around the X axis (Left,right). This will make the shader rotate along its width.
  • rotationY: Rotation angle in degrees around the Y axis (Up,down). This will make the shader rotate along its height.
  • rotationZ: Rotation angle in degrees around the Z axis (In,out). This will make the shader rotate in a similar way to the rotation argument in dxDrawImage.

Optional Arguments

  • rotationCenterOffsetX : The center of rotation offset X position in screen relative units.
  • rotationCenterOffsetY : The center of rotation offset Y position in screen relative units.
  • rotationCenterOffsetZ : The center of rotation offset Z position in screen relative units.
  • bRotationCenterOffsetOriginIsScreen : Set to true if the center of rotation origin should be the center of the screen rather than the center of the image.
  • perspectiveCenterOffsetX : The center of perspective offset X position in screen relative units.
  • perspectiveCenterOffsetY : The center of perspective offset Y position in screen relative units.
  • bPerspectiveCenterOffsetOriginIsScreen : Set to true if the center of perspective origin should be the center of the screen rather than the center of the image.

To convert screen relative units into screen pixel coordinates, multiply by the screen size. Conversely, to convert screen pixel coordinates to screen relative units, divide by the screen size.

Returns

Returns true if the shader element's transform was successfully changed, false otherwise.

Example


Requirements

Minimum supported server n/a
Minimum supported client 1.2.0-9.03618
Note: Using this function requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.2.0-9.03618" />

See Also

FROM VERSION 1.5.6 r14203 ONWARDS