Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Tiling images vertically in Parallax layers with Chingu...?
- By ml Date 2013-10-26 06:45
I'm using Chingu::Parallax to create a background.

It seems to automatically tile the images horizontally. I am hoping to tile the images vertically as well. Can anyone tell me if there a quick and easy way to accomplish this?

Here is the code I'm working with:

  def setup
    @parallax = Chingu::Parallax.create(:x => 0, :y => 0, :rotation_center => :top_left, :zorder => Zorder::Background)
    @parallax.add_layer(:image => "backgrounds/space1.png", :damping => 16)
    @parallax.add_layer(:image => "backgrounds/space2.png", :damping => 12)
    @parallax.add_layer(:image => "backgrounds/space3.png", :damping => 8)
  end

  def camera_right
    @parallax.camera_x += 2
  end

  def camera_up
    @parallax.camera_y -= 2
  end
Up Topic Gosu / Gosu Exchange / Tiling images vertically in Parallax layers with Chingu...?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill