Advertisement
Mux213

Untitled

Jun 25th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. func _process(delta):
  2.     simulate_fps += delta
  3.     if simulate_fps > (1.0 / target_fps):
  4.         simulate_fps = 0.0
  5.         render_target_update_mode = Viewport.UPDATE_ONCE
  6.        
  7.         # might not be set yet
  8.         var texture = $VRPreview.texture
  9.         if texture:
  10.             var textSize = texture.get_size()
  11.             var textSCale = size.x / textSize.x
  12.             $VRPreview.rect_size = textSize*textSCale
  13.             $VRPreview.rect_position = (size - $VRPreview.rect_size)*0.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement