Trouble getting the Tween at the right viewport at the start

Started by AndreasBlack, Sun 13/03/2022 11:12:21

Previous topic - Next topic

AndreasBlack

The screen should be positioned "differently" then the imported bakgroundscreen at the start, so i thought Room Load would be the correct place to put it.

However all i can seem to do is when the room shows up it adjusts itself to the right screen positioning, but it should happen before the fade in so you don't see it adjusting. I can't set it to 0.0, then i get a crash.

So how could i get the same result without a crash? Thanks!


Code: ags
function room_Load()

{
 
Screen.Viewport.TweenX(0.1, 200, eEaseInSineTween, eNoBlockTween);
Screen.Viewport.TweenY(0.1, 100, eEaseInSineTween, eNoBlockTween);

}




Matti

Why are you using Tween if you don't want to see the tweening? You could just set the Viewport/Camera directly.

AndreasBlack

Quote from: Matti on Sun 13/03/2022 11:56:42
Why are you using Tween if you don't want to see the tweening? You could just set the Viewport/Camera directly.

Give an example, i'm looking in the manual, can't find it.

  Game.Camera.SetPosition (640, 395); ??? Something like that?

.........................Why does something that seems so basic end up being so complicated (laugh)
EDIT:

Solution example for those who don't know themselfs such basic thing.

Code: ags
  Game.Camera.SetAt(380, 140);


The right "values". I was taking the values to extreme settings and nothing happened, i have no idea why, but now it's working


SMF spam blocked by CleanTalk