Windows A number of instances reverse the view angle

C

Cuerzor

Guest
I found this problem while I was rotating the view angle, and there are two GIFs to show that:



And I found that drawing things on surfaces will affect this, but I don't know how it works.
How can I resolve that?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
We have no idea how you resolve this as we have no idea what you are doing. If you want help then you'll need t post the code and details of the room setup, etc...
 
C

Cuerzor

Guest
We have no idea how you resolve this as we have no idea what you are doing. If you want help then you'll need t post the code and details of the room setup, etc...
These are the rotation code:
Code:
if !instance_exists(ReverseSatellite) and camera_get_view_angle(view_camera[0])!=0{
    view_reset_time += 1;
    view_reset_time = min(30,view_reset_time)
    camera_set_view_angle(view_camera[0],ease_in_and_out(180,0,30,view_reset_time))
    show_debug_message("view_reset_time = "+string(view_reset_time))
    show_debug_message("camera angle = "+string(camera_get_view_angle(view_camera[0])))
}else{
    view_reset_time = 0
}
And these are in the script ease_in_and_out:
Code:
/// @param start_value
/// @param end_Value
/// @param steps
/// @param x

var difference,denominator,midpoint,fraction,result;
difference=argument1-argument0
denominator=sqr(argument2)
midpoint=floor(argument2/2)
if argument3<=midpoint {
    fraction=2*sqr(argument3)/denominator
}else{
    fraction=(denominator-2*sqr(argument2-argument3))/denominator
}
result=difference*fraction+argument0
return result;
The room's width is 1400, height is 610. And the view width is 800, height is 600. And in the GIFs the position of the view is (320, 0).
Is there anything else needed?
 
C

Cuerzor

Guest
Now I found that surface_set_target() and surface_reset_target() will cause this issue. If Instances don't draw things on surfaces at all, this will not happen.
Does the event which the code's in affect this?
 
Last edited by a moderator:
C

Cuerzor

Guest
Well now I resolved this...
I put the fuction of drawing on surfaces in the Draw Begin event before...Now I move it into the pre-draw event and this resolved.
Sorry to be a nuisance. Please delete this post if don't mind...
 
Last edited by a moderator:
Top