Spawning actors off screen (solved)

Fool

  • Posts: 88
I'm trying to spawn an actor (part of my UI) offscreen. When triggered via a custom event the actor should tween in from the top
of the screen.

The problem is I can't seem to spawn them at negative y coordinates, say at y -64.

If anyone has a solution or an idea for this predicament I'd owe you one because I've tried everything I can think of so far. Thanks.

« Last Edit: February 01, 2017, 04:05:12 pm by Fool »

JeffreyDriver

  • Posts: 2262
That's a strange issue. I've done exactly what you're trying to do without a problem. Worth checking if there's any other code of behaviours stopping it from leaving the screen.

Can you tween it off the screen?

KramerGames

  • Posts: 405
I did have a similar issue when I tried to spawn actors past the maximum x-coordinate of the scene. In that case I jsut spawned them one pixel less than the maximum. Maybe if you go more into detail someone can provide you with a workaround.
Parasites United  (Idle Parasite Game)

Fool

  • Posts: 88
Quote from: JeffreyDriver
That's a strange issue. I've done exactly what you're trying to do without a problem. Worth checking if there's any other code of behaviours stopping it from leaving the screen.
Can you tween it off the screen?

Tried that, didn't work. Maybe because the layer it happens on is set to 0 scroll factor? Thanks Jeff.

Kramer, didn't think of that, though I decided to just fade-in/out the layer that the ui element is on instead of tweening
the actor itself. Gonna try Jeffs solution first, and then yours. Thanks!

morphman86

  • Posts: 141
I suspect that you're trying to place it above the upper side of the scene. You can spawn it outside the screen, but not outside the scene (as there's literally nothing there).

Try making the scene a bit taller than the screen, at least 26 pixels (as you're trying to put it at -25).
Programming equivalent of Jack-of-all-trades

Fool

  • Posts: 88
I suspect that you're trying to place it above the upper side of the scene. You can spawn it outside the screen, but not outside the scene (as there's literally nothing there).

Try making the scene a bit taller than the screen, at least 26 pixels (as you're trying to put it at -25).

Thanks Morphman, I suspected the same thing, but I don't know how to restrict the camera from the 'out of bounds' part of the scene.

Whats weird is I can tween and/or set the coordinates for another actor with the entirely same setup as the previous UI element and the problem resolves itself.  Heisenbugs are fun.

I'm trying to letter box for a cinematic effect. What I think needs to be done is manually placing the ui elements at the edge of the screen on a layer with 0 scroll factor, hiding them upon creation, tweening them off screen and then unhiding them and tweening the ui elements back onto screen when the cinematics are activated.

There a work around implemented where I just placed the blinders on the respective portions of the screen, top and bottom, set scroll factor to zero, and fade in the cinematic layer upon activation.

In any case things are working now, and I want to say thanks to each of you for your help.