GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Touchscreen

BuckyStarrBuckyStarr Posts: 12Member
edited November -1 in iPhone and Android Publishing
Sorry if this is answered elsewhere on the board.

Is there functionality in Gamesalad yet to access the Touchscreen capability of the iPhone/iPod Touch? This would be great to build "glass cockpit" type soft buttons and open up whole new avenues for development of game interfaces.

Thanks in advance

$e*

Comments

  • JGary321JGary321 Posts: 1,246Member
    The touchscreen is just associated with the "mouse down" behavior. So to click button by using touchscreen you just create rule so that

    Mouse Down & Mouse over actor.

    Hope this helps =)
  • BuckyStarrBuckyStarr Posts: 12Member
    Thanks Gary, it did very much!
  • jeffcollinsjeffcollins Posts: 13Member
    hi

    So to move an actor around the screen would you have to have a mouse down event or would you still have the self.position = game.mouse.position?

    thanks
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    Yes. Take a look at http://gamesalad.com/wiki/how_to_gsc_drag_and_drop_movement

    If you only had self.position = game.mouse.position then you would have an actor that jumps around the screen everytime you touch the screen.

    However this may change if/when multi-touch is enabled.
  • jeffcollinsjeffcollins Posts: 13Member
    thanks code monkey

    I really meant, moving an actor around the scene using the touch screen capability, I guess much like moving the paddle in the crazy ball breaker game
  • JGary321JGary321 Posts: 1,246Member
    Remember that Mouse = touchscreen. Everything that you assign to Mouse Down 7 Mouse over Actor means touch when you are playing on the iPhone. So, in the "Mouse Drag & Drop" tutorial, it will be the same as touch screen drag & drop.

    Mouse = Touch

    Hope this helps =)

    -JGary
  • beatragebeatrage Posts: 126Member
    5. Now here is the creative part. Edit the actor INSTANCE. Instead of constraining 'OffsetX' and 'OffsetY' to 0, constrain them to the Camera.Origin X and Y, respectively. You will find this under 'Current Scene → Camera → Origin' in the Expression Editor. Now that you can see the camera offset on a global level, all your actors in your scene can see the camera offset without you needing to modify each individual actor instance.

    I did´nt get it!
    you need to change the constrain of 'OffsetX' and 'OffsetY' to the camera origin...but HOW??is there an game.origin.x or game.origin.y(or just X and Y)??

    How can I take control of the camera position in-game using the constrain 'OffsetX' and 'OffsetY'?

    I have done a background 2880x320 and the camera is set to 480x320 with x=0 and y=0 too.

    I spent my monday just to prepare my character´s moviment so he could go up down and to the right and left with limits like screen width-220 and screen width-310 so he could go up and down and never goes offscreen.

    on the faq above they say:

    "You will find this under 'Current Scene → Camera → Origin' in the Expression Editor"

    I can´t find any camera origin on the Expression Editor!!

    Could some one here give me some thoughts on this one?
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    Hi beatrage.
    I wrote up the how-to for that. The big key word that is in all caps is "INSTANCE". An actor instance is one of the actors that is in the actual scene. This is opposed to the actor prototype that is in the actors list in the inspector.

    http://gamesalad.com/wiki/inspector_pane
    http://gamesalad.com/wiki/scene_attributes
  • beatragebeatrage Posts: 126Member
    Head Chef

    I know what an instance is!

    the problem is how can I find this:

    "You will find this under 'Current Scene → Camera → Origin' in the Expression Editor"

    I already have done it but my main doubt was:

    I gave a camera control to my main character ...and constrained his x and y position to another 2 variables called camerax and cameray on game atributtes but how can I use a rule to make my down(pressed) mouse to make my main character follow the mouse on a beat em up game that I can go up/down the limited area and to the left/right positions on a horizontal scrolling scene...but only when I press the mouse.Also I created 2 constrained variables called mousex and mousey to get accurate values of my mouse position.

    I have created a condition atributte rule that when my game.cameray(my character position constained) is less than game.mousex

    he animates and start moving to the right.

    but the problem is when I create a rule to the left direction and start moving my hero to the right with the camera he simply stop moving and scrolling the background (2880x320) after I have passed the first scene 480X320 camera...as my camera is locked and holding my character.....
    What could this be?I have seen all the other templates but there´s no example like this!The thing is how can I delegate my camera origin to other objects when the game is running??
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    Hey Member. I mean beatrage. ;)
    You can only have one actor controlling the camera at a time. All that means is that if your actor starts hitting the border of your camera controlling area, the camera will be moved along with it. This should override your behaviors that may try to change the camera origin attribute (which is not really a good way to move the camera).

    Now, if you want different actors to control the camera, you can set up a game attribute that controls the camera owner. e.g. the attribute is an integer which you can change with some rule. Then within each actor, you have a rule that checks the condition that if that game attribute is 1, or 2, or 3, etc (whichever you designate that actor to be), then Control Camera beahvior.

    Actor 1 has: If game.cameracontroller = 1, Control Camera
    Actor 2 has: If game.cameracontroller = 2, Control Camera ... etc.

    Have you posted your game on the website?
  • beatragebeatrage Posts: 126Member
    ok this one was a nice explanation!Thanks!!Head Chef

    no I am thinking in not realease it on the web but only on apple store...could it have any problems?

    my problem is that I am trying to have my temporary (Hackintosh desktop) to connect to the network, because of an incompatibility of network drivers....but as I have a notebook with windows and after finishing my graduation presentation next month I´ll install the leopard 10.5.2 on it!

    will it have any problems if I don´t have a network connection to develop on gamesalad??
    I can access the internet with windows and download/pay your license then download the .app generator and boot with leopard and install on it....right?

    but I´ll buy a macbook later for SURE!!
This discussion has been closed.