Camerascreen & -movement
#2

Quote:
Originally Posted by GiS
Посмотреть сообщение
Alright, well I get several questions which could assist me with a tutorial for new players of a server.
You are welcome

Quote:
Originally Posted by GiS
Посмотреть сообщение
At first I would like to know how I can create something like a camerascreen for a tutorial like here.
That are two black textdraw boxes, shouldnt be hard to make

Quote:
Originally Posted by GiS
Посмотреть сообщение
There you can see the LSPD without any Player infront of you. What kind of commands do I need for that?
Just set the player into an unique virtual world, I would recommand (playerid + 1) since 0 is the default world and playerid 0 shouldnt see that
Dont forget to set the world to 0 again if he spawns

Quote:
Originally Posted by GiS
Посмотреть сообщение
Second: I'd like to know how it's possible to make a movement of a camera if I got the screen of question one. Like for example the camera slowly flys around the LSPD building.
For that you only need the basic of trigonometry, lets say the camera should fly in a circle around the point

We create a function which call it self again till something happens (as example if the player spawns)
pawn Код:
forward TRotate(playerid, Float: X, Float: Y, Float: Z, Float: R, Float: A);
public TRotate(playerid, Float: X, Float: Y, Float: Z, Float: R, Float: A) {
    if(GetPlayerState(player) == PLAYER_STATE_WASTED) {
        SetCameraPos(playerid, X + (floatcos(A, degrees) * R), Y + (floatsin(A, degrees) * R), Z + 10);
        SetTimerEx("TRotate", 100, false, "ifffff", playerid, X, Y, Z, R, A + 1.0);
    }
}
Quote:
Originally Posted by GiS
Посмотреть сообщение
Third: How is it possible to make an image changing slowly like it slowly looses its oppacity? Let's say you got the image of the LSPD and now I want to change it to an image of the Cityhall. How can I make that it's not a fast changing of the image but a slow one like slowly the screen gets black and afterwards slowly the black screen disappears and looses its oppacity that the new image is visible?
For that you just create a function which creates a black box with 0 opacity and slowly change it to full opacity
And than change the camera pos / look at and afterwards let it go to 0 opacity again
pawn Код:
stock StartChange(playerid, Float: X, Float: Y, Float: Z, Float: cX, Float: cY, Float: cZ) {
    new Text:gText = TextDrawCreate(0.0, 0.0, "_");
    TextDrawUseBox(gText, true);
    cbOpacity(playerid, gText, 0, false, X, Y, Z, cX, cY, cZ);
}
pawn Код:
forward cbOpacity(playerid, Text:tText, opacity, bool: down, Float: X, Float: Y, Float: Z, Float: cX, Float: cY, Float: cZ);
public cbOpacity(playerid, Text:tText, opacity, bool: down, Float: X, Float: Y, Float: Z, Float: cX, Float: cY, Float: cZ) {
    TextDrawBoxColor(tText, opacity);
    if(down) {
        if(--opacity <= 0) {
            TextDrawDestroy(tText);
            return ;
        }
    } else {
        if(++opacity >= 255) {
            SetTimerEx("cbOpacity", 100, false, "iiib", playerid, _:tText, opacity, true);
            SetPlayerCameraPos(playerid, cX, cY, cZ);
            SetPlayerCameraLookAt(playerid, X, Y, Z);
            return;
        }
    }
    SetTimerEx("cbOpacity", 100, false, "iiib", playerid, _:tText, color, visible, X, Y, Z, cX, cY, cZ);
}
Everything not tested, just written out of fun
Reply


Messages In This Thread
Camerascreen & -movement - by GiS - 22.05.2011, 15:38
AW: Camerascreen & -movement - by Nero_3D - 22.05.2011, 16:37
Re: Camerascreen & -movement - by GiS - 22.05.2011, 17:07
AW: Re: Camerascreen & -movement - by Nero_3D - 22.05.2011, 21:52

Forum Jump:


Users browsing this thread: 1 Guest(s)