Render Object Functions

From Danmakufu Wiki
Jump to: navigation, search

ObjRender_SetX

Arguments:
 1) object ID (real)
 2) x-coordinate (real)

Sets the x-coordinate of the object.

ObjRender_SetY

Arguments:
 1) object ID (real)
 2) y-coordinate (real)

Sets the y-coordinate of the object.

ObjRender_SetZ

Arguments:
 1) object ID (real)
 2) z-coordinate (real)

Sets the z-coordinate of the object.

ObjRender_SetPosition

Arguments:
 1) object ID (real)
 2) x-coordinate (real)
 3) y-coordinate (real)
 4) z-coordinate (real)

Sets the x, y and z-coordinate of the object.

ObjRender_SetAngleX

Arguments:
 1) object ID (real)
 2) x-angle (real)

Sets the x-angle of the object.

ObjRender_SetAngleY

Arguments:
 1) object ID (real)
 2) y-angle (real)

Sets the y-angle of the object.

ObjRender_SetAngleZ

Arguments:
 1) object ID (real)
 2) z-angle (real)

Sets the z-angle of the object.

ObjRender_SetAngleXYZ

Arguments:
 1) object ID (real)
 2) x-angle (real)
 3) y-angle (real)
 4) z-angle (real)

Sets the x, y and z-angle of the object.

ObjRender_SetScaleX

Arguments:
 1) object ID (real)
 2) x-scale (real)

Sets the x-scale of the object.

ObjRender_SetScaleY

Arguments:
 1) object ID (real)
 2) y-scale (real)

Sets the y-scale of the object.

ObjRender_SetScaleZ

Arguments:
 1) object ID (real)
 2) z-scale (real)

Sets the z-scale of the object.

ObjRender_SetScaleXYZ

Arguments:
 1) object ID (real)
 2) x-scale (real)
 3) y-scale (real)
 4) z-scale (real)

Sets the x, y and z-scale of the object.

ObjRender_SetColor

Arguments:
 1) object ID (real)
 2) R (real)
 3) G (real)
 4) B (real)

Sets the color of the object using RGB (0-255).

ObjRender_SetColorHSV

Arguments:
 1) object ID (real)
 2) Hue (real)
 3) Saturation (real)
 4) Value (real)

Sets the Hue (0-359), Saturation (0-255), and Value (0-255) of an object.

ObjRender_SetAlpha

Arguments:
 1) object ID (real)
 2) alpha (real)

Sets the alpha value of the object. A value of 0 will make the object invisible. A value of 255 will give the object full opacity. Alpha blend type must be used for this to work. To get a transparent render using additive blend, the color has to be set to black (0, 0, 0) using ObjRender_SetColor.

ObjRender_SetBlendType

Arguments:
 1) object ID (real)
 2) blend type (real)

Sets the blend type for the specified object. Available blend types are:

BLEND_ALPHA

Overlays the image on top of the background, using the image's alpha values to determine transparency of individual pixels.

(r1, g1, b1) * a1/255 + (r2, g2, b2) * (1 - (a1/255))

BLEND_ADD_RGB

Adds the image's pixel values to those of the background, resulting in a brighter image.

(r1, g1, b1) + (r2, g2, b2)

BLEND_MULTIPLY

Multiplies the image's pixel values with those of the background, as a ratio from 0 to 255.
For example, an image multiplied by solid white will result in the same image, and an image multiplied by solid gray (127, 127, 127) will result in an image with half the brightness.

(r1, g1, b1) * (r2, g2, b2) / 255

BLEND_SUBTRACT

Subtracts the image's pixel values from those of the background, resulting in a darker image.

(r2, g2, b2) - (r1, g1, b1)

BLEND_ADD_ARGB

Adds the image's pixel values to those of the background, using the image's alpha values to determine transparency of individual pixels.

(r1, g1, b1) * a1/255 + (r2, g2, b2)

BLEND_INV_DESTRGB

Inverts the color of the background in relation to the intensity of the image's pixel values. Also known as exclusion blending.

The closer the image's pixel values are to 255, the more the background is inverted in that color. The closer the image's pixel values are to 0, the less it is inverted in that color.
What this results in is a linear scale between the inverted background, half-intensity (127), and the original background color.

For example, a solid white image will invert the background pixels exactly. A solid red image (255, 0, 0) will invert only the background pixels' red values, but not affect the green or blue values.

(r1, g1, b1) + (r2, g2, b2) - 2 * (r1, g1, b1) * (r2, g2, b2) / 255

BLEND_SHADOW (undocumented)

Inverts the image's pixel values, then applies multiply-blend with the background.

((255, 255, 255) - (r1, g1, b1)) * (r2, g2, b2) / 255

ObjRender_GetX

Arguments:
 1) object ID (real)

Returns: x-coordinate (real)

Returns the x-coordinate of the object.

ObjRender_GetY

Arguments:
 1) object ID (real)

Returns: y-coordinate (real)

Returns the y-coordinate of the object.

ObjRender_GetZ

Arguments:
 1) object ID (real)

Returns: z-coordinate (real)

Returns the z-coordinate of the object.

ObjRender_GetAngleX

Arguments:
 1) object ID (real)

Returns the x-angle of the object.

ObjRender_GetAngleY

Arguments:
 1) object ID (real)

Returns the y-angle of the object.

ObjRender_GetAngleZ

Arguments:
 1) object ID (real)

Returns the z-angle of the object.

ObjRender_GetScaleX

Arguments:
 1) object ID (real)

Returns the x-scale of the object.

ObjRender_GetScaleY

Arguments:
 1) object ID (real)

Returns the y-scale of the object.

ObjRender_GetScaleZ

Arguments:
 1) object ID (real)

Returns the z-scale of the object.

ObjRender_GetBlendType

Arguments:
 1) object ID (real)

Returns the blend type for the specified object. Available blend types are:

  • BLEND_ALPHA
  • BLEND_ADD_RGB
  • BLEND_MULTIPLY
  • BLEND_SUBTRACT
  • BLEND_ADD_ARGB
  • BLEND_INV_DESTRGB

ObjRender_SetZWrite

Arguments:
 1) object ID (real)
 2) bool

Allows or prevents the object from writing in the Z-buffer.

ObjRender_SetZTest

Arguments:
 1) object ID (real)
 2) bool

Sets whether or not the object uses the Z-buffer.

ObjRender_SetFogEnable

Arguments:
 1) object ID (real)
 2) bool

Allows or prevents the object from being affected by the fog. Defaults to true.

ObjRender_SetPermitCamera

Arguments:
 1) object ID (real)
 2) bool

Determines whether the object is affected by the 2D camera. If set to false, the object will not be affected by the camera regardless of render priority.