***Method for making ANY object unscrollable***

3xL3xL Member Posts: 676
edited March 2012 in Working with GS (Mac)
Maybe some of you already know this. So forgive me, but I'm just trying to help out. 

I noticed when I uncheck the "scrollable" box in the "layers" tab, this layer moves up the list. 

So un scrollable layers can't be under a scrollable layer?

Anyhow, here's what I did in my scenario. 

I have a level with a sun. And I want to sun to ALWAYS stay in the center of the camera. But the sun is in the back of the HUD and level objects layers. 

Layer 1: HUD  (score, life, items pause button)

Layer 2: Enemies, hero and all that

Later 3: Sun

My camera size is:

Height: 600
Width: 800

So here is the sun's behaviors:

Constrain self.position. X
To
Scene.camera.Origin. X+400

I added those extra 400 pixels since the camera is 800 pixels wide and I want the sun to be at the center of the camera's position. What's half of 800? 400. 

So now to sun moves along with the camera where ever the camera goes. 

This is a easy method to make any actor on ANY layer un scrollable. 

Hopes this helps somebody :)

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I'm pretty sure you can have unsrcollable layers that are not on top - I know that I have done it in a number of games with multiple versions of GS. Sometimes GS is a little quirky with layers so you may just need to uncheck a layer and then reopen the scene and move it to the bottom of the list.

    The reason I would try that instead of the method above is that each constrain that you use will have an effect on the games FPS.
  • 3xL3xL Member Posts: 676
    True true.

    Maybe it was a gotch I was experience then :/

    I would have to add a new layer and uncheck it.. But it would move that new layer to the top the moment I uncheck it. Darn you gs quirkiness!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Yeah un-scrollable layers do not move when you deselect them. are you sure you where just clicking the deselect and not dragging it by accident.
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    Lol I think you were clicking the wrong things... I have a game in the workings with an object on an unscrollable layer under other layers....
  • 3xL3xL Member Posts: 676
    Trust me they DO move for me. Unless my Mac is possessed by some windows spirit!

    Maybe if I uninstall gs and reinstall it will fix it. No worries. Thanks Guys.
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    Lol... You're either drunk or your version of GS is drunk :D
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    @3xL can you post a video of this happening? I just tested this and it is not happening for me. The layer stays right were it belongs
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    Do you have movable checked or unchecked? You probs want to unchecked movable...
  • 3xL3xL Member Posts: 676
    Lol... You're either drunk or your version of GS is drunk :D
    My gs was drunk lol
    I re installed and it stopped. Weird.
Sign In or Register to comment.