Render Functions

From Danmakufu Wiki
Jump to: navigation, search

LoadTexture

Arguments:
 1) path (char)

Loads specified image file as a texture.

LoadTextureInLoadThread

Arguments:
 1) path (char)

Loads specified image file as a texture in a separate thread.

Using this function inside @Loading is the same as using LoadTexture.

When using large images, the script will freeze until the image has finished loading.

RemoveTexture

Arguments:
 1) path (char)

Removes specified texture file.

GetTextureWidth

Arguments:
 1) path (char)

Returns the width (real) of the specified image file.

GetTextureHeight

Arguments:
 1) path (char)

Returns the height (real) of the specified image file.

SetFogEnable

Arguments:
 1) true / false (bool)

Enables or disables fog.

SetFogParam

Arguments:
 1) starting point (distance from the camera)
 2) ending point (distance from the camera)
 3) color (R)
 4) color (G)
 5) color (B)

Sets parameters for the fog effect.

To turn the screen dark, you can use SetFogParam(250, 700, 0, 0, 0).

SetInvalidRenderPriorityA1

Arguments:
 1) invalid render priority (start) (real)
 2) invalid render priority (end) (real)

Sets invalid render priority. Drawing within the specified range will be disabled afterwards.

ClearInvalidRenderPriority

Clears the invalid render priority set beforehand with SetInvalidRenderPriorityA1.

GetReservedRenderTargetName

Arguments:
 1) index (0-2) (real)

Acquires the render target name reserved at Danmakufu's startup.

The texture acquired by this function necessarily exists.

CreateRenderTarget

Arguments:
 1) name of the target (char)

Can create a custom render target outside of the reserved ones. To use, ObjPrim_SetTexture must have the name of the render target as a string.

Example:

 CreateRenderTarget("My Render Target");
 ObjPrim_SetTexture(objname, "My Render Target");

Returns true if the render target was successfully created.

RenderToTextureA1

Arguments:
 1) name of the target (char)
 2) invalid render priority (start) (real)
 3) invalid render priority (end) (real)
 4) render target clear (bool)

Renders the specified range of invalid render priority drawings to a texture.

RenderToTextureB1

Arguments:
 1) name of the target (char)
 2) object ID (real)
 3) render target clear (bool)

Renders the specified object to texture.

SaveRenderedTextureA1

Arguments:
 1) target name (char)
 2) file name (char)

Saves rendered texture to file.

The image file created by this function can be used immediately after its execution.

SaveRenderedTextureA2

Arguments:
 1) target name (char)
 2) file name (char)
 3) save rectangle (left) (real)
 4) save rectangle (up) (real)
 5) save rectangle (right) (real)
 6) save rectangle (down) (real)

Saves rendered texture to file.

You have to set the coordinates of the region to capture.

The image file created by this function can be used immediately after its execution.

SaveSnapShotA1

Arguments:
 1) file name (char)

Saves a picture of the game to file.

The image file created by this function can be used immediately after its execution.

SaveSnapShotA2

Arguments:
 1) file name (char)
 2) save rectangle (left) (real)
 3) save rectangle (top) (real)
 4) save rectangle (right) (real)
 5) save rectangle (bottom) (real)

Saves a picture of the game to file.

You have to set the coordinates of the region to capture.

The image file created by this function can be used immediately after its execution.

IsPixelShaderSupported

Arguments:
 1) Integer
 2) Decimal (input as an integer value)

Checks your whether or not your GPU supports the specified pixel shader version. Returns true if supported.

Example: IsPixelShaderSupported(3, 0); //checks for Pixel Shader version 3.0

SetShader

Arguments:
 1) shader object ID
 2) render priority I
 3) render priority II

Starts rendering all textures within the specified render priority range to the shader object.

SetShaderI

Arguments:
 1) shader object ID
 2) render priority I
 3) render priority II

Starts rendering textures within the specified render priority range (integer) to the shader object.

ResetShader

Arguments:
 1) render priority I
 2) render priority II

Stops rendering textures within the specified render priority range to the shader object.

ResetShaderI

Arguments:
 1) render priority I
 2) render priority II

Stops rendering textures within the specified render priority range (integer) to the shader object.