On this page
klaytonkowalski/library-defold-rendy/rendy.rendy
A versatile camera suite and render pipeline
- GitHub: klaytonkowalski/library-defold-rendy — pinned to
2fe3aed- Pick a release from klaytonkowalski/library-defold-rendy releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as rendy from "rendy.rendy"
- Pick a release from klaytonkowalski/library-defold-rendy releases and add its Source code (zip) URL (or a packaged
Functions
create_camera(camera_id: CameraId)destroy_camera(camera_id: CameraId)set(camera_id: CameraId, property: Hash | string, value: any)animate(camera_id: CameraId, property: Hash | string, playback: typeof go.PLAYBACK_LOOP_BACKWARD | typeof go.PLAYBACK_LOOP_FORWARD | typeof go.PLAYBACK_LOOP_PINGPONG | typeof go.PLAYBACK_ONCE_BACKWARD | typeof go.PLAYBACK_ONCE_FORWARD | typeof go.PLAYBACK_ONCE_PINGPONG, to: Quaternion | Vector3 | Vector4 | number, easing: Vector3 | typeof go.EASING_INBACK | typeof go.EASING_INBOUNCE | typeof go.EASING_INCIRC | typeof go.EASING_INCUBIC | typeof go.EASING_INELASTIC | typeof go.EASING_INEXPO | typeof go.EASING_INOUTBACK | typeof go.EASING_INOUTBOUNCE | typeof go.EASING_INOUTCIRC | typeof go.EASING_INOUTCUBIC | typeof go.EASING_INOUTELASTIC | typeof go.EASING_INOUTEXPO | typeof go.EASING_INOUTQUAD | typeof go.EASING_INOUTQUART | typeof go.EASING_INOUTQUINT | typeof go.EASING_INOUTSINE | typeof go.EASING_INQUAD | typeof go.EASING_INQUART | typeof go.EASING_INQUINT | typeof go.EASING_INSINE | typeof go.EASING_LINEAR | typeof go.EASING_OUTBACK | typeof go.EASING_OUTBOUNCE | typeof go.EASING_OUTCIRC | typeof go.EASING_OUTCUBIC | typeof go.EASING_OUTELASTIC | typeof go.EASING_OUTEXPO | typeof go.EASING_OUTINBACK | typeof go.EASING_OUTINBOUNCE | typeof go.EASING_OUTINCIRC | typeof go.EASING_OUTINCUBIC | typeof go.EASING_OUTINELASTIC | typeof go.EASING_OUTINEXPO | typeof go.EASING_OUTINQUAD | typeof go.EASING_OUTINQUART | typeof go.EASING_OUTINQUINT | typeof go.EASING_OUTINSINE | typeof go.EASING_OUTQUAD | typeof go.EASING_OUTQUART | typeof go.EASING_OUTQUINT | typeof go.EASING_OUTSINE, duration: number, delay?: number, complete_function?: (this: any, url: Url, property: Hash) => void)cancel_animations(camera_id: CameraId, property: Hash | string)get(camera_id: CameraId, property: Hash | string): unknownget_display_size(): Vector3get_window_size(): Vector3get_stack(screen_x: number, screen_y: number): CameraId[]shake(camera_id: CameraId, radius: number, intensity: number, duration: number, scaler?: number)cancel_shake(camera_id: CameraId)screen_to_world(camera_id: CameraId, screen_position: Vector3): Vector3world_to_screen(camera_id: CameraId, world_position: Vector3): Vector3
create_camera(camera_id: CameraId)
Creates a camera. This function is called automatically by the rendy.go game object.
Parameters
camera_id:CameraId— The identifier for the camera.
destroy_camera(camera_id: CameraId)
Destroys a camera. This function is called automatically by the rendy.go game object.
Parameters
camera_id:CameraId— The identifier for the camera to be destroyed.
set(camera_id: CameraId, property: Hash | string, value: any)
Sets a camera property. This function replaces the standard go.set().
Parameters
camera_id:CameraId— The identifier for the camera.property:Hash | string— The property to be set.value:any— The value to set the property to.
animate(camera_id: CameraId, property: Hash | string, playback: typeof go.PLAYBACK_LOOP_BACKWARD | typeof go.PLAYBACK_LOOP_FORWARD | typeof go.PLAYBACK_LOOP_PINGPONG | typeof go.PLAYBACK_ONCE_BACKWARD | typeof go.PLAYBACK_ONCE_FORWARD | typeof go.PLAYBACK_ONCE_PINGPONG, to: Quaternion | Vector3 | Vector4 | number, easing: Vector3 | typeof go.EASING_INBACK | typeof go.EASING_INBOUNCE | typeof go.EASING_INCIRC | typeof go.EASING_INCUBIC | typeof go.EASING_INELASTIC | typeof go.EASING_INEXPO | typeof go.EASING_INOUTBACK | typeof go.EASING_INOUTBOUNCE | typeof go.EASING_INOUTCIRC | typeof go.EASING_INOUTCUBIC | typeof go.EASING_INOUTELASTIC | typeof go.EASING_INOUTEXPO | typeof go.EASING_INOUTQUAD | typeof go.EASING_INOUTQUART | typeof go.EASING_INOUTQUINT | typeof go.EASING_INOUTSINE | typeof go.EASING_INQUAD | typeof go.EASING_INQUART | typeof go.EASING_INQUINT | typeof go.EASING_INSINE | typeof go.EASING_LINEAR | typeof go.EASING_OUTBACK | typeof go.EASING_OUTBOUNCE | typeof go.EASING_OUTCIRC | typeof go.EASING_OUTCUBIC | typeof go.EASING_OUTELASTIC | typeof go.EASING_OUTEXPO | typeof go.EASING_OUTINBACK | typeof go.EASING_OUTINBOUNCE | typeof go.EASING_OUTINCIRC | typeof go.EASING_OUTINCUBIC | typeof go.EASING_OUTINELASTIC | typeof go.EASING_OUTINEXPO | typeof go.EASING_OUTINQUAD | typeof go.EASING_OUTINQUART | typeof go.EASING_OUTINQUINT | typeof go.EASING_OUTINSINE | typeof go.EASING_OUTQUAD | typeof go.EASING_OUTQUART | typeof go.EASING_OUTQUINT | typeof go.EASING_OUTSINE, duration: number, delay?: number, complete_function?: (this: any, url: Url, property: Hash) => void)
Animates a camera property. This function replaces the standard go.animate().
Parameters
camera_id:CameraId— The identifier for the camera.property:Hash | string— The property to be animated.playback:typeof go.PLAYBACK_LOOP_BACKWARD | typeof go.PLAYBACK_LOOP_FORWARD | typeof go.PLAYBACK_LOOP_PINGPONG | typeof go.PLAYBACK_ONCE_BACKWARD | typeof go.PLAYBACK_ONCE_FORWARD | typeof go.PLAYBACK_ONCE_PINGPONG— The playback mode of the animation.to:Quaternion | Vector3 | Vector4 | number— The target value of the animation.easing:Vector3 | typeof go.EASING_INBACK | typeof go.EASING_INBOUNCE | typeof go.EASING_INCIRC | typeof go.EASING_INCUBIC | typeof go.EASING_INELASTIC | typeof go.EASING_INEXPO | typeof go.EASING_INOUTBACK | typeof go.EASING_INOUTBOUNCE | typeof go.EASING_INOUTCIRC | typeof go.EASING_INOUTCUBIC | typeof go.EASING_INOUTELASTIC | typeof go.EASING_INOUTEXPO | typeof go.EASING_INOUTQUAD | typeof go.EASING_INOUTQUART | typeof go.EASING_INOUTQUINT | typeof go.EASING_INOUTSINE | typeof go.EASING_INQUAD | typeof go.EASING_INQUART | typeof go.EASING_INQUINT | typeof go.EASING_INSINE | typeof go.EASING_LINEAR | typeof go.EASING_OUTBACK | typeof go.EASING_OUTBOUNCE | typeof go.EASING_OUTCIRC | typeof go.EASING_OUTCUBIC | typeof go.EASING_OUTELASTIC | typeof go.EASING_OUTEXPO | typeof go.EASING_OUTINBACK | typeof go.EASING_OUTINBOUNCE | typeof go.EASING_OUTINCIRC | typeof go.EASING_OUTINCUBIC | typeof go.EASING_OUTINELASTIC | typeof go.EASING_OUTINEXPO | typeof go.EASING_OUTINQUAD | typeof go.EASING_OUTINQUART | typeof go.EASING_OUTINQUINT | typeof go.EASING_OUTINSINE | typeof go.EASING_OUTQUAD | typeof go.EASING_OUTQUART | typeof go.EASING_OUTQUINT | typeof go.EASING_OUTSINE— The easing function for the animation.duration:number— The duration of the animation.delay?:number— Optional delay before starting the animation.complete_function?:(this: any, url: Url, property: Hash) => void— Optional function to be called when the animation is complete.
cancel_animations(camera_id: CameraId, property: Hash | string)
Cancels a camera property animation. This function replaces the standard go.cancel_animations().
Parameters
camera_id:CameraId— The identifier for the camera.property:Hash | string— The property of the animation to be cancelled.
get(camera_id: CameraId, property: Hash | string): unknown
Gets a camera property. This function is equivalent to the standard go.get().
Parameters
camera_id:CameraId— The identifier for the camera.property:Hash | string— The property to be retrieved.
Returns
unknown— The value of the specified property.
get_display_size(): Vector3
Gets the initial window size specified in the game.project file.
Returns
Vector3— The initial window size.
get_window_size(): Vector3
Gets the current window size.
Returns
Vector3— The current window size.
get_stack(screen_x: number, screen_y: number): CameraId[]
Gets camera ids whose viewports intersect a screen position.
Parameters
screen_x:number— The x-coordinate of the screen position.screen_y:number— The y-coordinate of the screen position.
Returns
CameraId[]— An array of camera ids.
shake(camera_id: CameraId, radius: number, intensity: number, duration: number, scaler?: number)
Starts a camera shake animation. If the camera is already shaking, then the animation is cancelled and restarted. The radius is increased or decreased over time if the scaler argument is ~= 1.
Parameters
camera_id:CameraId— The identifier for the camera.radius:number— The initial radius of the camera shake.intensity:number— The intensity of the camera shake.duration:number— The duration of the camera shake animation.scaler?:number— Optional scaler argument for adjusting the radius over time.
cancel_shake(camera_id: CameraId)
Cancels an ongoing camera shake animation.
Parameters
camera_id:CameraId— The identifier for the camera.
screen_to_world(camera_id: CameraId, screen_position: Vector3): Vector3
Converts a screen position to a world position. The screen position's z component maps to the camera frustum's z component.
Parameters
camera_id:CameraId— The identifier for the camera.screen_position:Vector3— The screen position to be converted.
Returns
Vector3— The corresponding world position.
world_to_screen(camera_id: CameraId, world_position: Vector3): Vector3
Converts a world position to a screen position. The world position's z component maps to the camera frustum's z component.
Parameters
camera_id:CameraId— The identifier for the camera.world_position:Vector3— The world position to be converted.
Returns
Vector3— The corresponding screen position.