GameSalad

Moving camera by touch only the size of the actor

KIIVIINKIIVIIN Posts: 159
edited February 2016 in Working with GS (PC)

Hello,

Well Im trying to make a map for my game. A map that show where they player are in the game.
Anyways, the map is around 2000x2000 pixels and puting that actor on scene is lot bigger then the camera HxW.
I wounder if there is a way to "move" the camer on scene by touch? I found a tutorial on forums with a green display on youtube last night on my phone but now its lost -_-!

Anyone that got a good tutorial or could help me?
Easy said, I want to move the camera by touch and not the actor "map".

Edit : I also dont want it to scroll more than the size of the actor "2000x2000".

regards

Comments

  • KevinCrossKevinCross London, UKPosts: 1,888
    edited February 2016

    Search for "pan scene" on the forums. It's not that difficult. I'm working on a project now that has it but not at home to send an example.

    Edit: Haven't downloaded or tried the example in this comment but try this one:

    http://forums.gamesalad.com/discussion/comment/532639/#Comment_532639

  • KIIVIINKIIVIIN Posts: 159

    @KevinCross said:
    Search for "pan scene" on the forums. It's not that difficult. I'm working on a project now that has it but not at home to send an example.

    Edit: Haven't downloaded or tried the example in this comment but try this one:

    http://forums.gamesalad.com/discussion/comment/532639/#Comment_532639

    Cool! I didnt know the name so I randomly searched for touch scroll scene .... haha

  • KIIVIINKIIVIIN Posts: 159

    @KevinCross said:
    Search for "pan scene" on the forums. It's not that difficult. I'm working on a project now that has it but not at home to send an example.

    Edit: Haven't downloaded or tried the example in this comment but try this one:

    http://forums.gamesalad.com/discussion/comment/532639/#Comment_532639

    The download by @Armelline dosnt work. Chrome and my virus program alert / trashes the download haha..

  • KevinCrossKevinCross London, UKPosts: 1,888

    @KIIVIIN said:

    @KevinCross said:
    Search for "pan scene" on the forums. It's not that difficult. I'm working on a project now that has it but not at home to send an example.

    Edit: Haven't downloaded or tried the example in this comment but try this one:

    http://forums.gamesalad.com/discussion/comment/532639/#Comment_532639

    The download by @Armelline dosnt work. Chrome and my virus program alert / trashes the download haha..

    Just had the same problem. There's bound to be other posts with instructions/examples on how to do it. If you're still having no luck finding one I'll upload an example later.

  • KIIVIINKIIVIIN Posts: 159

    @KevinCross said:

    @KIIVIIN said:

    @KevinCross said:
    Search for "pan scene" on the forums. It's not that difficult. I'm working on a project now that has it but not at home to send an example.

    Edit: Haven't downloaded or tried the example in this comment but try this one:

    http://forums.gamesalad.com/discussion/comment/532639/#Comment_532639

    The download by @Armelline dosnt work. Chrome and my virus program alert / trashes the download haha..

    Just had the same problem. There's bound to be other posts with instructions/examples on how to do it. If you're still having no luck finding one I'll upload an example later.

    Man been searching youtube, google and forums for pan scrolling / pan camera settings cannot find how to set it up esp to make it follow the touch only the size of the "picture" that I set on the scene. Lets say I have my map 2000x2000 pixel I want to be able to "scroll" the scene with the touch to see different parts of the map :&/

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,276

    I posted a free iOS style image carousel file a week or two ago you could check out. In that file I'm scrolling the screen via touch to move from one image to the next. I know you want to just scroll your whole scene and not just image by image like the carousel does, but you could likely change the file to suite your needs. The video and files links are located in the thread below if you want to check it out.

    http://forums.gamesalad.com/discussion/69271/tutorials-and-free-stuff-from-jamie-c#latest

  • KIIVIINKIIVIIN Posts: 159

    @jamie_c said:
    I posted a free iOS style image carousel file a week or two ago you could check out. In that file I'm scrolling the screen via touch to move from one image to the next. I know you want to just scroll your whole scene and not just image by image like the carousel does, but you could likely change the file to suite your needs. The video and files links are located in the thread below if you want to check it out.

    http://forums.gamesalad.com/discussion/69271/tutorials-and-free-stuff-from-jamie-c#latest

    But the thing you do in the video is to drag the image to a cetain x position then it show the next image. what I need is that when you drag the touch it "drag" the camera across the surface of the scene. Lets say my scene is 2000x2000 since the map "picture" I use is that big I want to be able to touch move the camera to see different parts of the map or better said to see parts that the camera cannot see since its so big.

    Also by doing this the camera should not go higher then or wider then Y / X is set since having the camera outside the image "map" looks bad.

    I tried to find this pan camera function that @Armelline posted but cannot see anyone done one or explaning how its done ://

  • KIIVIINKIIVIIN Posts: 159

    I cannot explain how I mean but its like the map is magnified and the scene camera is the magifyer(?) sorry for the spelling haha

  • KevinCrossKevinCross London, UKPosts: 1,888

    How I've done it is have one large background actor. This can be invisible (mine is) or visible like Armeline's example in that previous post. The actor needs to be the size of the scene. And there's some rules on that that moves the camera when you touch it and move your finger across it. The actor itself doesn't move. It use Camera Constrains, Mouse Positions, and the min and max functions.

    I'm still at work (it's early afternoon here) but will definitely send something later.

  • KIIVIINKIIVIIN Posts: 159

    @KevinCross said:
    How I've done it is have one large background actor. This can be invisible (mine is) or visible like Armeline's example in that previous post. The actor needs to be the size of the scene. And there's some rules on that that moves the camera when you touch it and move your finger across it. The actor itself doesn't move. It use Camera Constrains, Mouse Positions, and the min and max functions.

    I'm still at work (it's early afternoon here) but will definitely send something later.

    Well thats exatly what I need because on this map actor I got other actors that the player press so he ends up on that scene for the map position. So only moving the camera position is what I need. Puting the rule inside the map actor is correct but Im not femilliar with the camera functions yet thats why I need the help how it works. Checked the forum and found "drag background" still checking that function but would be nice if you could show me a demo. Thank you!

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,276

    The actor needs to be the size of the scene. And there's some rules on that that moves the camera when you touch it and move your finger across it.

    I did a similar thing in my file except I have an actor that only covers the live area of the scene and is on a non-scrolling layer. This actor has some rules that scroll the camera NOT the images.

  • KIIVIINKIIVIIN Posts: 159

    Its solved. Managed to download the @Armelline project that was mentioned before and had help by @Approw to manage the max / min function. Thank you for the help! :)

  • KevinCrossKevinCross London, UKPosts: 1,888

    I know you've solved it but I created a template before I saw your last post so thought I'd still share it

    http://www.kevincross.co.uk/?attachment_id=194

Sign In or Register to comment.