Viewport with Buttons and Foreground
Posted: Thu Sep 10, 2015 11:00 am
Our game is a point & click adventure, and some areas of the level are navigable spaces wider than the screen size (ie. scroll left & right to look around - the environment is a long, narrow train car). I'm trying to implement a parallax scrolling effect, so that the foreground image moves slightly slower than the background one. I did this by making a screen with 2 viewports in it:
And it works relatively well (though having the foreground and background speeds different means that it acts strange at the edges, and using the scrollbar means that the foreground and background don't scroll in sync...)
But now comes the next step, adding imagebuttons! The scene needs things for the player to interact with. An imagemap kind of worked, but with 7k pixel wide screens, I don't want to have to keep making pairs of image for each little change in the scene. However, when I added the imagebutton;the background stops scrolling altogether!
Anyone have any idea what could be causing it?
Code: Select all
label proSalon:
screen salonViewport:
viewport id "salonViewportBG":
scrollbars "horizontal"
side_xpos 0
side_ypos 0
draggable True
mousewheel True
edgescroll (150, 800)
add "ASSETS/PROLOGUE/Salon/salon car.png"
viewport id "salonViewportFG":
edgescroll (150, 900)
add "ASSETS/PROLOGUE/Salon/foreground asset.png"
But now comes the next step, adding imagebuttons! The scene needs things for the player to interact with. An imagemap kind of worked, but with 7k pixel wide screens, I don't want to have to keep making pairs of image for each little change in the scene. However, when I added the imagebutton;
Code: Select all
label proSalon:
screen salonViewport:
viewport id "salonViewportBG":
scrollbars "horizontal"
side_xpos 0
side_ypos 0
draggable True
mousewheel True
edgescroll (150, 800)
add "ASSETS/PROLOGUE/Salon/salon car.png"
imagebutton auto "ASSETS/PROLOGUE/Salon/gramaphone %s.png" xpos 1524 ypos 324 action Jump("proMusic") # ---------- ie, this
viewport id "salonViewportFG":
edgescroll (150, 900)
add "ASSETS/PROLOGUE/Salon/foreground asset.png"
Anyone have any idea what could be causing it?