camera_get_view_speed_x


Description

This function can be used to retrieve the movement speed of the given camera along the x axis (horizontal movement). The return value will be in pixels per game frame.


Syntax:

camera_get_view_speed_x(camera_id)


Arguments:

Argument Description
camera_id The unique camera ID value returned when you created the camera


Returns:

Real


Example:

var xs = camera_get_view_speed_x(view_camera[0]);
var ys = camera_get_view_speed_y(view_camera[0]);
if xs != 5 || ys != 5
   {
   camera_set_view_speed(view_camera[0], 5, 5);
   }

The above code retrieves the xspeed and yspeed of the camera assigned to view port[0] and then checks this to see if it matches the given value. If it does not then the view camera is set to that speed.


Back: Cameras
Next: camera_get_view_speed_y
© Copyright YoYo Games Ltd. 2017 All Rights Reserved