Parallax Background help

MentirasMentiras Posts: 49Member

I am having issues with my background parallax layers rendering to slowly.

Any help would be greatly appreciated. I found a similar problem while looking for a solution that said that I should enable region on my sprite and set h/w accordingly but when I enable region my sprite disappears.

Answers

  • GogetaXGogetaX Posts: 76Member
    edited July 12

    if u want the background to appear correctly,
    u have to set the sprite size exact same as the viewport size.
    im not sure if its a feature or a bug, but i found the same problem like u had. and thats how i fixed it..

    #get view port size:
    var ViewPortSize = get_viewport().get_visible_rect().size
    
    #Resize the sprite to a viewport:
    $BG.scale.x = ViewPortSize.x / $BG.texture.get_size().x
    $BG.scale.y = ViewPortSize.y / $BG.texture.get_size().y
    
  • MentirasMentiras Posts: 49Member

    Didn't seem to help me, all though I could be implementing it wrong. Thank you for the suggestion though.

Sign In or Register to comment.