I don't understand what your script does, Organican... can you please explain?
Okay...
First I created an "empty" entity in the scene - no sprite, no nothing.
I called it "diagonal_camera"
You can call it what you wish of course.
Here I made an invisible entity in SceneEdit that I will attach the camera to in a moment. It will be controlling the scrolling.
Then I attached a script to it.
And in the script, I wrote:
Code:
while(true)
{ this.X=actor.X;
this.Y=actor.X;
Sleep(50);
}
This means that the diagonal_camera entity's x and y positions will be the same as the actors.
If the actor is at x200, then the diagonal_camera will be at x200 y200. If he's at x350, it will be at (350, 350).
And when the camera control is attached to it, the scene will scroll from the upper-left corner to the lower-right, diagonally.
Then all I had to do was to add the lines
Code:
var diagonal_camera = Scene.GetNode("diagonal_camera");
Game.MainObject = diagonal_camera;
in the scene.init script
The line Game.MainObject = diagonal_camera;
means that the diagonal_camera entity will be given control of the scrolling.
If the scene is turned the other way
/--/
/--/
/--/
/--/
/--/
<-2500->
Then you have to do some calculations.
Take the width of the game area and subtract the width of the screen from it.
If the game area is 2500 pixels across, and the screen size is 800*600,
then you calculate 2500-800=1700
Next you type this in the diagonal camera_script instead:
while(true)
{
this.X=actor.X;
this.Y=1700-actor.X;
Sleep(50);
}
And do everything else like the other example.
I haven't tried this code, though. But it should work just like the other one that I tried.
Simple math.
Update:
Tales just posted in the thread and explained just what he meant by diagonal.
I see...
In that case...
No, I'm not sure how that can be done.
But it's a very interesting concept, Tales.
Update again:I think it can be done if you rotate the background image like you already did.
Then if you rotate the actor with the rotate code
actor.Rotate=-45;
both the scene and the character will be seen from the new camera angle.
Just remember to add the line
ROTATABLE = TRUE
in the actor file.
For molly (from the wme demo), the file is called molly.actor
In it, it should look something like this:
; $EDITOR_PROJECT_ROOT_DIR$ ..\..\..\
ACTOR
{
NAME = "molly"
CAPTION=""
SCALABLE = TRUE
ROTATABLE = TRUE
...
You can open it up in notepad.
This could be one way to do it. To rotate every actor and entity like this (and rotate the background in a graphics program).
Not sure if it would use a lot of processing power though.
It's worth a try at least.
Edit againI noticed that the scale levels in WME only works horizontally.
So that means that the scene can't have any scaling in the "z dimension", because it will look wierd if things to the right looks bigger etc.
So the only way to do this then, is to either have very little rotation in the scene, just a few degrees.
Or... if the scene's walkable area is "paper thin", or flat, like a 2d platformer (Mario) or something...
or if it just takes place in one plane... like a narrow path...
then it might work. But unfortunately, with horizontal scale levels, you have to find a way to do without the scaling in such a scene.
Though it might be worth it if the character and the scene is rotated, 60 degrees to the left or something.
That would be really cool.
But it means that the actor can't walk in the "z direction", towards and away from the screen... in the "depth" dimension.
Because he'll become bigger when he moves to the right if it looks like your picture.
So if you can do this, you will probably just use it in a few scenes. Because the player can't walk around much.
Sorry
This was the best I could do.