Stencyl 3.4.0 is now out. Get it now!

Multiple views?

squeeb

  • Posts: 954
http://www.stencyl.com/game/play/36845

 i have an actor (ball) that i want the camera to follow around ( i have that working)
i have another actor (bat) that is always at the bottom of the scene, i want to be able to see the bottom of the scene and the bat on the bottom 1/3  of the device screen or so, however i want the camera to follow the ball and display what would normally be seen on screen on the top 2/3 of the device screen.. does that make sense?  Is this possible? 

LIBERADO

  • *
  • Posts: 2209
Use the Image API to take a snapshot of the bottom of the scene, then attach it to a upper layer and continuously adjust its Y coordinate to place it at the bottom of the screen.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

squeeb

  • Posts: 954
I haven't been successful taking parts of the scene and displaying it.  Did you have a code snippet?  I can figure out the displaying it on the bottom of screen, I'd think haha

Or can you have 2 cameras?  I've only found a couple little things with haxe and multiple cameras

« Last Edit: July 14, 2017, 04:04:53 pm by squeeb »

LIBERADO

  • *
  • Posts: 2209
I don't know if Haxe allows to use several cameras simultaneously.

In a "when created" event, place the camera at the bottom of the scene, then use a delay of at least 0.04 seconds before using the Image API to take a snapshot of the screen.

<a href="http://static.stencyl.com/games/37208-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/37208-0.swf</a>
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

squeeb

  • Posts: 954
Yes! Exactly what I want. I've tired to get it going with varied results.  Should I add instances to list and remove from list as well? Theres a lot of lag and i haven't figured out how to grab just part of the correct screen area either.  I'll keep playing with it

LIBERADO

  • *
  • Posts: 2209
The method is much simpler than you imagine. You don't have to use lists.
And there is no lag because you only have to use a single image instance.
   
I have attached to this post the project file of the example shown above. You can download and check it.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

squeeb

  • Posts: 954
ahh.. ok i see what you did.. what if i dont want to update the bat, and if there were multiple balls, or other things at the bottom of the scene.. how could i actually see what was going on at the bottom of the scene,  i may be doing my lists wrong,  click mouse to swing bat
<a href="http://static.stencyl.com/games/36845-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/36845-0.swf</a>

LIBERADO

  • *
  • Posts: 2209
With the Image API you can take a snapshot of the part of the scene in which the camera is located.
But you cannot take a snapshot of the bottom of the scene while the camera is located elsewhere.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

squeeb

  • Posts: 954
Ahh. Ok.. hmmm.. theres got to be a way to get that effect.  I feel I've seen it on NES or something old haha.  I'll try a few other things

squeeb

  • Posts: 954
<a href="https://www.youtube.com/v/_r9tvhuVqLk" target="_blank" class="new_win">https://www.youtube.com/v/_r9tvhuVqLk</a>

theres gotta be a way!! haha... this was was what i was talking about.. see how you can see the paddles the whole time, i used to play this as a kid haha..  anyone have an idea how to get this effect?  maybe not image api.. attach bat and bottom of the scene actors to it and update the y?  if there were multiple balls, i couldnt hit them though.. id really like to see whats down at the bottom of the scene though, thoughts?

JeffreyDriver

  • Posts: 971
You could have the bottom bit as a separate background image, and the paddles anchored in place as the camera follows the ball. The only issue is that you would have to make sure that the ball never beats the camera to the bottom of the screen otherwise the player will be able to tell what's actually happening.

squeeb

  • Posts: 954
You could have the bottom bit as a separate background image, and the paddles anchored in place as the camera follows the ball. The only issue is that you would have to make sure that the ball never beats the camera to the bottom of the screen otherwise the player will be able to tell what's actually happening.
Yeah.. unless there are other actors or balls at the bottom of scene id need to interact with

Bombini

  • *
  • Posts: 768
Would this be the same approach for a split screen 2 player game (on one screen)?

squeeb

  • Posts: 954
Actually.. I think it would work for that too... I could only find small things about multiple cameras in haxe to read about..